Using ADO:
Dim adoConnection As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Dim ConnectionString As String
Set adoConnection = New ADODB.Connection
Set adoRecordset = New ADODB.Recordset
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\Highways\VB Projects\Project Files HWPE\CentralPhotoDatabase.mdb"
adoConnection.Open ConnectionString
If adoConnection.State = adStateOpen Then
MsgBox "CONNECTION OPEN!"
End If
adoRecordset.Open "Photos", adoConnection
The "CONNECTION OPEN!" message box comes up OK so I know that that bit works but when the last line executes VB complain that its expecting an SQL statement. On the MSDN site I've read that the first parameter CAN be a valid table name (incidently "Photos" IS the correct table name).
Any help???
thanks
Dim adoConnection As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Dim ConnectionString As String
Set adoConnection = New ADODB.Connection
Set adoRecordset = New ADODB.Recordset
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\Highways\VB Projects\Project Files HWPE\CentralPhotoDatabase.mdb"
adoConnection.Open ConnectionString
If adoConnection.State = adStateOpen Then
MsgBox "CONNECTION OPEN!"
End If
adoRecordset.Open "Photos", adoConnection
The "CONNECTION OPEN!" message box comes up OK so I know that that bit works but when the last line executes VB complain that its expecting an SQL statement. On the MSDN site I've read that the first parameter CAN be a valid table name (incidently "Photos" IS the correct table name).
Any help???
thanks