求链接access数据库代码。急用 高分奉上
要快啊,急用,给我可以用的码,做软件有
[解决办法]
Dim s() As String
Dim cnn As New OleDbConnection
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Projects\tt.mdb"
cnn.Open()
Dim ds As New DataSet
Dim da As New OleDbDataAdapter("select * from table", cnn)
cnn.Close()
da.Fill(ds, "table")
If ds.Tables(0).Rows.Count <> 0 Then
' Dim s As String = ds.Tables(0).Rows(0).ToString()
Dim i As Integer
For i = 0 To ds.Tables(0).Rows.Count - 1
s(i) = ds.Tables(0).Rows(i)("id").ToString()
Next
End If
Dim con As New OleDbConnection
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\db\db.mdb"
con.Open()