gojets1721
Registered User.
- Local time
- Today, 12:22
- Joined
- Jun 11, 2019
- Messages
- 430
Right now, I use this guide to show me who is currently logged into the DB. It works fine for me, but admittedly, its more difficult for the less experienced access users on the team to utilize. I was curious if anyone had any suggestions on how to maybe convert this to a query? So that all the users just populate there, instead of having to open the module and insert into the immediate window
The guide's code is below too:
The guide's code is below too:
Code:
Sub ShowUserRosterMultipleUsers()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Set cn = CurrentProject.Connection
' The user roster is exposed as a provider-specific schema rowset
' in the Jet 4.0 OLE DB provider. You have to use a GUID to
' reference the schema, as provider-specific schemas are not
' listed in ADO's type library for schema rowsets
Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
'Output the list of all users in the current database.
Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _
"", rs.Fields(2).Name, rs.Fields(3).Name
While Not rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1), _
rs.Fields(2), rs.Fields(3)
rs.MoveNext
WEnd
End Sub