Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you determine if a linked database is open?

Status
Not open for further replies.

N2Life

Programmer
Dec 21, 2002
90
US
Database A contains a link to a table in Database B. This link is, of course, valid even if Database B is closed. Is there a way in VBA code within Database A to check if Database B is indeed open? I am using Windows XP, Access 2000.

Something like:
Function LinkedDatabaseIsOpen("DatabaseB.mdb") As Boolean
... some code [ which is what I am asking for ]
LinkedDatabaseIsOpen = True ' Or maybe False
End Function

My thanks in advance to the helpful experts in these forums.
N2Life
 
Check for the lock file
Code:
LinkedDatabaseIsOpen = dir("DatabaseB.ldb")>""
 
Very clever! And the simplest approach is always the best. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top