There are 3 ways I can think of:
1: Have each user create a record in a logging table when they enter the database and remove it when they leave. Problem is if they leave in a way you have not planned for.
2: Read the ldb file, count the length of the text inside it & divide by the length when there is only 1 person in it (I used to know this number, can't think of it off hand tho!)
3: I once used some code from the M$ website I think that read the ldb file and counted the users and worked out who they were. I'm not sure how I found it, but you could try the knowledge base.
I'm sure there's an easier way than these!
Ben ----------------------------------
Ben O'Hara
bo104@westyorkshire.pnn.police.uk
----------------------------------
Option Explicit
Global Const JET_SCHEMA_USERROSTER = _
"{947bb102-5d43-11d1-bdbf-00c04fb92675}"
Function ADOUserRoster()
Dim cnn As New ADODB.Connection
Dim rst As ADODB.Recordset
' Open the connection
' cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
' "Data Source=.\NorthWind.mdb;"
cnn.Open CurrentProject.Connection
' Open the user roster schema rowset
Set rst = cnn.OpenSchema(adSchemaProviderSpecific, , _
JET_SCHEMA_USERROSTER)
' Print the results to the debug window
' to check who is logged on.
Debug.Print rst.GetString
Dim cnt As Integer, indx As Integer
cnt = 0
rst.MoveFirst
For indx = 0 To 2000
If Not rst.EOF Then
cnt = cnt + 1
Else
Exit For
End If
rst.MoveNext
Next '- end for
Debug.Print "count of connections = "; cnt
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.