Results 1 to 2 of 2
  1. #1
    Jaik is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Aug 2016
    Posts
    33

    Run-Time error '3251' showuser code from Microsoft

    Hello guys,


    I got code from Microsoft below.
    This code is to find out who's currently in the database.
    I checked Microsoft ActiveX Data Objects 2.1 Library
    from reference, but still getting 3251 error.


    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
    I am getting error
    for this lines of code

    Code:
      Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
        , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
    Run-Time error '3251' "Object or Provider is not capable of performing requested operation."

    Does anyone have an idea why this is not working?

    thank you

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    not familiar with the code but might be to do with

    The user roster is exposed as a provider-specific schema rowset in the Jet 4.0 OLE DB provider.
    2007 uses ACE, so perhaps the code is not valid

    or perhaps

    You have to use a GUID to reference the schema,
    but this

    "{947bb102-5d43-11d1-bdbf-00c04fb92675}"
    is a string that looks like a guid

    suggest google the guidfromstring function

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 02-01-2016, 08:27 AM
  2. Audit Trail Code - Error 3251
    By Juans in forum Access
    Replies: 3
    Last Post: 01-04-2015, 02:21 PM
  3. Checkbox OldValue property gives Error 3251
    By Monterey_Manzer in forum Programming
    Replies: 11
    Last Post: 05-06-2014, 03:10 PM
  4. VBA Code Returning Error Run Time Error 3061
    By tgwacker in forum Access
    Replies: 2
    Last Post: 11-24-2013, 11:00 AM
  5. Replies: 9
    Last Post: 06-08-2012, 07:52 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums