Error - Users Logged in

sunnyk2057

New member
Local time
Today, 08:23
Joined
Apr 2, 2015
Messages
1
Hi All

I am using the below code (picked from Microsoft website) to identify users currently logged in

Code:
Sub ShowUserRosterMultipleUsers()
    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(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

It was working fine for few days, but now all of sudden it started showing following error:confused:

Object or provider is not capable of performing requested operation

Any help
 
My first guess would be your library references changed. You can search the forum to read up on the topic...
 
Does the error drop you into the VBA screen? If so, what precisely is highlighted?

Ken's right, though - my first guess is references got fubared. Is this, by chance, an Access 2003 file that may have been opened in A2013?
 

Users who are viewing this thread

Back
Top Bottom