J
JCIrish
Environment is Access 2007 Vista Ultimate 64 bit.
The following code runs fine in a standard module on the database where it
was written. If I take the same code and put it in another database, changing
the project and table references where appropriate, and step through it, I
get the run-time error "Cannot finds installable ISAM" at the code line
"cnn1.Open strConnection"
Can someone tell me what gives here and how to correct this?
Sub TestRecordCount()
Dim cnn1 As ADODB.Connection
Dim rsMyPeople As ADODB.Recordset
Dim strConnection As String
strConnection = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & CurrentProject.Path & "\Contacts.accdb;"
Set cnn1 = New ADODB.Connection
cnn1.Open strConnection
Set rsMyPeople = New ADODB.Recordset
With rsMyPeople
.CursorType = adOpenStatic
.Open "[Contacts Primary Data Table]", cnn1
End With
Debug.Print "The Total Number of Records is: " & rsMyPeople.RecordCount
cnn1.Close
Set rsMyPeople = Nothing
Set cnn1 = Nothing
End Sub
The following code runs fine in a standard module on the database where it
was written. If I take the same code and put it in another database, changing
the project and table references where appropriate, and step through it, I
get the run-time error "Cannot finds installable ISAM" at the code line
"cnn1.Open strConnection"
Can someone tell me what gives here and how to correct this?
Sub TestRecordCount()
Dim cnn1 As ADODB.Connection
Dim rsMyPeople As ADODB.Recordset
Dim strConnection As String
strConnection = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & CurrentProject.Path & "\Contacts.accdb;"
Set cnn1 = New ADODB.Connection
cnn1.Open strConnection
Set rsMyPeople = New ADODB.Recordset
With rsMyPeople
.CursorType = adOpenStatic
.Open "[Contacts Primary Data Table]", cnn1
End With
Debug.Print "The Total Number of Records is: " & rsMyPeople.RecordCount
cnn1.Close
Set rsMyPeople = Nothing
Set cnn1 = Nothing
End Sub