The following code is supposed to determine what users are logged on to an Access DB. It was received from http://support.microsoft.com/kb/285822
. I created a module named ShowUsers as instructed, and am using Microsoft ActiveX Data Objects 6.1 Library. The code compiles but when I open the Immediate window, type ShowUserRosterMultipleUser
s and press enter, nothing happens. I also closed and reopened the file to try again but nothing changed. I'm using Access 2010 in a Citrix environment and don't know if that impacts what is supposed to happen.
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim i, j As Long
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(adSchemaProv
'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), _
Currently I'm the only user logged into the file so would expect my user ID to appear. Please advise if I must do something else to make this process work.