How can I check if someone else has the Access database open in VBA? (1 Viewer)

omnialive

Registered User.
Local time
Today, 15:56
Joined
Sep 17, 2010
Messages
23
I have found how to check if the database was opened in Shared mode and exit the application if so. I've found lots of things, but not what I am looking for.

I need to be able to check via VBA if someone else has the database open and if possible, what they have open/locked.

How would I do this? I suspect it is easy, but several web searches and searches on this forum have not yielded what I am after.

I am using Access 2007.
 

MarkK

bit cruncher
Local time
Today, 15:56
Joined
Mar 17, 2004
Messages
8,186
This returns a recordset with some useful data, but not what the user is doing.
Code:
Function RsUsers(DbPath As String) As ADODB.Recordset
   Dim cn As New ADODB.Connection
   cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DbPath
   Set RsUsers = cn.OpenSchema(adSchemaProviderSpecific, , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
End Function
 

Users who are viewing this thread

Top Bottom