Database in use Status -

supercharge

Registered User.
Local time
Today, 13:33
Joined
Jun 10, 2005
Messages
215
Hello all,

I've already run searches on this but found nothing exactly matched.

Here is the situation that hopefully you guys, experts, can help.

I have several databases and on the main one (master one), I want to be able to show status of other databases, whether they are in use (meaning being open) or not. Is this possible?

They are all in the same drive.

Thank you all in advance. ;)

Access 2003
 
You could check for the existance of the record locking file [*.ldb] which should only exist if the db is opened by any number of users.

Who and how would anybody really benefit from your quest?
 
ghudson said:
You could check for the existance of the record locking file [*.ldb] which should only exist if the db is opened by any number of users.

I already know that it will create a locking file but how would I go about checking for the existing of that file?

ghudson said:
Who and how would anybody really benefit from your quest?

Everybody can benefit from this. How about when you want to open an Access database then later fnd out that somebody is using it? If you know ahead of time (status), you won't have to waste time trying it. Agree?

Thanks
 
There is a "FindFile" (or is it FileFind ... I can never remember, being the old fart that I am...) that you can use to do file searches - including searches for .LDB files of any name. Then, once you have searched, there is a FilesFound collection as part of the FileFind object that you can step through to see which names are open. After all, the name of the .LDB matches the name of the .MDB - and you kept your .MDB names unique, didn't you?

(But you can even do a sub-folder search with FileFind and see the path of the Found File, so if the names are the same but the paths are not, you are still OK.)
 
Hopefully you have correctly designed your application so that multiple users can open and access the data. A db that can only be accessed by one user at a time is pretty useless. ;)

Use the quick and easy Dir() function to test if the .ldb file exists. Search around for there are a ton of posts on how to verify if a file exists.
 
Thanks to those who responded.

Here is another challenge that's in addition to the original request. Now that I can see whether a certain database is in use by another user, is it possible to tell remotely the machine name or username of that machine?

I can retrieve my machine and username of my own computer, but not remotely.

Thanks
 
Open the .ldb with notepad. The info is inside. There are other applications that will do this for you but this is quick and easy.
 

Users who are viewing this thread

Back
Top Bottom