472,985 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,985 software developers and data experts.

Is External Database Open

Hello,
My current application opens and runs a procedure in a separate Access
database. It looks like this.

Public Sub ProcessAll()
Dim appAccess As New Access.Application
appAccess.OpenCurrentDatabase ("G:\RebateReport.mdb")
appAccess.Run "ProcessAll"
appAccess.CloseCurrentDatabase
End Sub

The problem is "RebateReport.mdb" must be closed or it will not
process. I need code that would close it if it were open and then
re-open and run it.

I need to add something like:

appAccess.Path="G:\RebateReport.mdb"
If appAccess.IsOpen Then
appAccess.FileClose
EndIf

Of course this is improper syntax. How would I do this?
Nov 12 '05 #1
5 1993
Check whether G:\RebateReport.ldb exists.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"neptune" <bs**********@hotmail.com> wrote in message
news:c5**************************@posting.google.c om...
Hello,
My current application opens and runs a procedure in a separate Access
database. It looks like this.

Public Sub ProcessAll()
Dim appAccess As New Access.Application
appAccess.OpenCurrentDatabase ("G:\RebateReport.mdb")
appAccess.Run "ProcessAll"
appAccess.CloseCurrentDatabase
End Sub

The problem is "RebateReport.mdb" must be closed or it will not
process. I need code that would close it if it were open and then
re-open and run it.

I need to add something like:

appAccess.Path="G:\RebateReport.mdb"
If appAccess.IsOpen Then
appAccess.FileClose
EndIf

Of course this is improper syntax. How would I do this?

Nov 12 '05 #2
On Thu, 04 Mar 2004 22:54:09 GMT, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.com> wrote:

Cool !
I would NEVER have thought of that. I was about to use at least half a
dozen API calls to answer the question.

-Tom.

Check whether G:\RebateReport.ldb exists.


Nov 12 '05 #3
Douglas J. Steele wrote:
Check whether G:\RebateReport.ldb exists.

Try to delete it, it may be left over from a crashed workstation.

--
But why is the Rum gone?
Nov 12 '05 #4
Trevor Best <nospam@localhost> wrote in message news:<40**********************@auth.uk.news.easyne t.net>...
Douglas J. Steele wrote:
Check whether G:\RebateReport.ldb exists.

Try to delete it, it may be left over from a crashed workstation.


Thanks for the tip. I realized a new instance isn't opening because a
..ldb file exists from a previous crash. I checked to see if it exists
and try to delete it.

If Dir("G:\RebateReport.ldb") <> "" Then
Kill "G:\RebateReport.ldb"
End If

The Kill command results in an error, "permission denied" I've used
the kill to delete word files, but I don't understand why it doesn't
delete the lock file.
Nov 12 '05 #5
neptune wrote:
Trevor Best <nospam@localhost> wrote in message news:<40**********************@auth.uk.news.easyne t.net>...
Douglas J. Steele wrote:

Check whether G:\RebateReport.ldb exists.


Try to delete it, it may be left over from a crashed workstation.

Thanks for the tip. I realized a new instance isn't opening because a
.ldb file exists from a previous crash. I checked to see if it exists
and try to delete it.

If Dir("G:\RebateReport.ldb") <> "" Then
Kill "G:\RebateReport.ldb"
End If

The Kill command results in an error, "permission denied" I've used
the kill to delete word files, but I don't understand why it doesn't
delete the lock file.


If it can't delete the lock file (with Permission Denied) then it's
because the file is open on another workstation or the crashed
workstation hasn't had it's connection cleared yet.
--
But why is the Rum gone?
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kathy Benson | last post by:
Hi, I need to open an external file, such as *.htm from a Java program. I need to open this file by the default program that handles this extension on the machine. So *.htm should always be opened...
2
by: Ian Davies | last post by:
Hello Stefan or anyone else who can help Some time ago you suggested a solution to my original post about connecting to data on a remote server from a VB application where my host doesnt allow a...
1
by: Martin_Hurst | last post by:
Is it possible to establish a connection from within a postgres database to another external database on the network, i.e., not a java or scripting connection, BUT by some type of table definition...
4
by: intl04 | last post by:
How do I create a data input form in Access that is external to the Access database to which it's connected (if that's possible, which I believe it is)? For example, if someone clicks on an Access...
1
by: Aged | last post by:
Hi I have asked several groups now for advise but I feel I must be confusing either them or myself, but anyway here goes! Below is code taken from the "OnClick" function of a command button...
0
by: David Helgason | last post by:
I think those best practices threads are a treat to follow (might even consider archiving some of them in a sort of best-practices faq), so here's one more. In coding an game asset server I want...
55
by: salad | last post by:
I have contained in a listbox the Window's caption, the class name for the window, and the hWND of the window. Is there a way, using the data from above, to activate/set focus to that window?
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
5
by: Ian | last post by:
I am trying to: 1. Open a form on the external database 2. Enter a value in a text box on that form I have 1 above working OK using module form “The Access Web”, the module looks like this: ...
15
Zwoker
by: Zwoker | last post by:
Hi all, I am accessing data from an Oracle database via a connect string. I got into the situation where I wanted to write my SQL select statement to do a join between a local table sitting in...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.