Test for loaded application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

Is there a method to test if an external database is open – something like

A bit like the IsLoaded (but for an external D Base)

If ABC.mde isOpen then
‘do something’
Else
‘do something else’
End if

Any tips would be really appreciated
 
Hi Wayne,

As long as the database is not opened in exclusive mode, you should be able
to test for the presense of a locking database file (*.ldb) in the same
folder. If there is no .ldb file present, then it's probably safe to assume
that no one else has it open.

If Len(Dir(ABC.ldb) = 0 Then
' File is probably not open
End If


LDB Viewer Form
http://www.mvps.org/access/modules/mdl0055.htm


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
Hi Tom

The Database I want to check is almost always open during office hours BUT
it "may" not be.

What I am doing is simply runing an import and overwrite table to a laptop
but I need to check that the main DB is open 1st (or I can't import).

So if the DB "is" open I will run an import from the laptop - if the main DB
is "not" open I will call shell to open it then run the import and then
(using the same shell call to a macro) close the main DB again.

Of course this all goes out the window if the server is running scheduled
backups etc, as I code all operations on the server this I can get round this
and anything the server or terminals are doing

The main thing I can't find out is how to check if the main DB is open or not.

Any suggestions
 
Hi Wayne,
The main thing I can't find out is how to check if the main DB is open or not.

Open on your computer, or open by anyone else? As far as I know, the only
way to know if someone else might have the database open is to check for the
existance of the locking database file, which should be there as long as it
was not opened in exclusive mode.
What I am doing is simply runing an import and overwrite table to a laptop
but I need to check that the main DB is open 1st (or I can't import).

I'm a little confused by this description. Also, do you really need to
overwrite an existing table? Why not just delete all records from a remote
table, and then use an append query to add the current records back in?


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top