' workgroup security ODBC
Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;SystemDB=C:\mydatabase.mdw;
' example of a connection
Dim cnn As ADOBE.Connection
Set cnn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=C:\mydatabase.mdb;SystemDB=C:\mydatabase.mdw;
cnn.Open
Dim strSQL As String
strSQL = "SELECT * FROM tblMyTable"
Dim rst As New ADODB.RecordSet
With rst
.Open strSQL, cnn
If Not .EOF Then
' do something with the recordset
End If
.Close
End With
Set rst = Nothing
Set cnn = Nothing
|