J
jason
my access database name is test.mdb
inside this database have two fields,name and number
and the form have one command and one datagrid.
following is my coding about to link that databse, but
also can't connect,anyone can correct my code or tell me
how to do....thx
Private Sub cmd1_Click()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim cnstr As String
Dim i As Integer
Set cn = New ADODB.Connection
cn.Connectstring = "Provider=Microsoft.Jet.OLEDB.3.51;"
& "Data Source=c:\jason file\testing\test.mdb"
cn.Open cnstr
Set rs = New ADODB.Recordset
rs.Open "test", cn
For i = 1 To 4
data = rs!Name
rs.MoveNext
Next i
rs.Close
cn.Close
End Sub
inside this database have two fields,name and number
and the form have one command and one datagrid.
following is my coding about to link that databse, but
also can't connect,anyone can correct my code or tell me
how to do....thx
Private Sub cmd1_Click()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim cnstr As String
Dim i As Integer
Set cn = New ADODB.Connection
cn.Connectstring = "Provider=Microsoft.Jet.OLEDB.3.51;"
& "Data Source=c:\jason file\testing\test.mdb"
cn.Open cnstr
Set rs = New ADODB.Recordset
rs.Open "test", cn
For i = 1 To 4
data = rs!Name
rs.MoveNext
Next i
rs.Close
cn.Close
End Sub