Determine if LDB file exists or if any users are in a DB

X

XP

I have the following function which normally returns TRUE if a file exists:

Public Function FileExists(argFullName As String) As Boolean
'RETURNS TRUE IF THE FILE EXISTS
FileExists = Len(Dir(argFullName)) > 0
End Function

However, I am trying to determine if any user is in a DB by checking for
existence of the .ldb file and the above function does not detect it.

Does anyone have a function that can determine if the .ldb file for a DB
exists, or whether any users are presently in a shared DB (opened for shared
mode)?

If you have a function that can do this, could you please post it? Thanks.
 
J

John Spencer

That should work if there is an .ldb file. Check the argFullName value and
make sure it is accurate and has the full path name in it along with the
file name of the ldb.

I just tested here (Access 2000 and Windows XP) and it worked for me.

Dir(Replace(currentdb().name,".mdb",".ldb")) returned the name of the
associated ldb file.
 
X

XP

Thanks John, you were right, I had a single character wrong in the path that
I overlooked...thanks.
 

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

Top