Is another DB opened exclusive

X

XP

In Office 2003:

Does anyone have a working VBA function that will ping another DB and return
TRUE if the DB has been opened exclusively; false if not?

If so, could you please post it? Thanks.
 
R

Roger Carlson

Function OpenExclusiveTest(Filename As String) As Boolean
On Error GoTo Err_OpenExclusiveTest

Dim db As DAO.Database
Set db = OpenDatabase(Filename)
OpenExclusiveTest = False

Exit_OpenExclusiveTest:
Exit Function

Err_OpenExclusiveTest:
If Err.Number = 3045 Then
OpenExclusiveTest = True
End If
Resume Exit_OpenExclusiveTest
End Function


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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