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