Back-end users - can I count them?

  • Thread starter Thread starter Dennis Snelgrove
  • Start date Start date
D

Dennis Snelgrove

Is it possible to find out the number of users in a back-end at a given
time? Is there a function out there that someone has written that will
return the count?
 
Hi,

Using ADO you can create a recordset of users:

Dim intUsers As Integer
Dim rst As ADODB.Recordset
Const JET_SCHEMA_USERROSTER = "{947bb102-5d43-11d1-bdbf-00c04fb92675}"
Set rst = CurrentProject.Connection.OpenSchema( _
adSchemaProviderSpecific, , JET_SCHEMA_USERROSTER)
If rst.EOF Or rst.BOF Then
Else
rst.MoveFirst
End If
Do Until rst.EOF
intUsers = intUsers + 1
Debug.Print rst![LOGIN_NAME]
Debug.Print rst![COMPUTER_NAME]
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
MsgBox "Users: " & intUsers, vbInformation, "Done"


The User Recorset contain the following fields:

COMPUTER_NAME
LOGIN_NAME
CONNECTED
SUSPECT_STATE


HTH

--

Cheers
Mark

Free Access/Office Add-Ins at:
http://mphillipson.users.btopenworld.com/
 
Dennis said:
Is it possible to find out the number of users in a back-end at a given
time? Is there a function out there that someone has written that will
return the count?


You didn't say what version of Access you're using. I
haven't used it but I think the newest version has something
built in that helps you do that.

There is also the JetUtils download on the MS web site that
includes the msLDBusr DLL that I've used for this purpose.
 
Back
Top