I’ve just started playing with automation and I’ve borrowed the example from SAMPLES.xls
I’ve tried changing the details that I think affect me and it won’t work.
(I’ve tried running the example before changing it, and it doesn’t work either
but probably for different reasons.)
With the code below;
Sub RetrieveMydata()
”’ NOTE: This subroutine requires that you reference the
”’ latest version of the following library:
”’
”’ Microsoft ActiveX Data Objects Library
Dim conn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim NewBook As Workbook
Dim PathToDatabase As String
Dim i As Integer
‘ Create the Connection object.
Set conn = New ADODB.Connection
‘ Set Database path string
PathToDatabase = “C:aaaQ2workmaindatamaindataQ2_2ka.mdb”
With conn
‘Assign the connection string to the connection object.
.ConnectionString = “DRIVER={Microsoft dBase Driver (*.dbf)};” & _
“DBQ=” & PathToDatabase & “;” & _
“DefaultDir=” & PathToDatabase & “”
‘ Open the connection.
.Open strconn
End With
I get an invalid path at the .ConnectionString line. I’ve tried looking at help but there seems to be no real help available telling me how to build it. (On this note, I can see an entry for the item “connections”, “connection property”, etc but clicking on them does nothing. Is there a seperate help file that might have been missed during install?)
Also, just a possibility, how do I tell if I have the dBase driver installed?
TIA
Brooke