Results 1 to 2 of 2
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    provider Microsoft.Jet.OLEDB.4.0 cannot be found... (?)

    just a bit over my head....



    I've got this snippet (below) to provide a list of all of users the that have a database open (F:\TDA_Master_Specifications\TDAMasterDATA.mdb), but am getting hung up on a line of code (that deals with a topic I am not yet at all familiar with...)

    and that line is:
    cn.Provider = "Microsoft.Jet.OLEDB.4.0"
    PROVIDER CANNOT BE FOUND...
    and indeed, it is not in the reference library

    I suspect that this code may have been written for 32bit, and possibly also previous versions of windows / access (?)

    currently I am in Windows 7, Office Pro plus 2013, and 64-bit
    Would you be able to tell me what I ought to be using / looking for instead?
    And / or direct me to an article that could enlighten me...

    Code:
    Sub ShowUserRosterMultipleUsers()
        Dim cn As New ADODB.Connection
        Dim cn2 As New ADODB.Connection
        Dim rs As New ADODB.Recordset
        Dim i, j As Long
    
        cn.Provider = "Microsoft.Jet.OLEDB.4.0"
        cn.Open "Data Source = F:\TDA_Master_Specifications\TDAMasterDATA.mdb"
    
        cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
        & "Data Source=F:\TDA Master Specifications\TDAMasterDATA.mdb"
    
        ' The user roster is exposed as a provider-specific schema rowset
        ' in the Jet 4 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
    with many thanks in advance,
    mark

  2. #2
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349

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

Similar Threads

  1. Provider of CurrentProject
    By Joakim N in forum Programming
    Replies: 2
    Last Post: 11-13-2016, 11:53 PM
  2. Replies: 2
    Last Post: 05-20-2016, 01:30 AM
  3. OleDB Provider is not registered
    By Perceptus in forum Access
    Replies: 1
    Last Post: 01-22-2015, 01:35 PM
  4. Replies: 5
    Last Post: 07-15-2011, 12:11 PM
  5. oledb not installed?
    By bbxrider in forum Access
    Replies: 0
    Last Post: 04-20-2010, 01:36 PM

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