473,322 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 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 2008
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.