Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
XP - 15 Nov 2006 16:47 GMT
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.
John Spencer - 15 Nov 2006 17:08 GMT
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.

>I have the following function which normally returns TRUE if a file exists:
>
[quoted text clipped - 12 lines]
>
> If you have a function that can do this, could you please post it? Thanks.
XP - 15 Nov 2006 18:05 GMT
Thanks John, you were right, I had a single character wrong in the path that
I overlooked...thanks.

> 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
[quoted text clipped - 21 lines]
> >
> > If you have a function that can do this, could you please post it? Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.