数据库连接问题求助
Dim myconn As New System.Data.OleDb.OleDbConnection
Dim strcnn As String
strcnn = "provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\data.mdb"
myconn.ConnectionString = strcnn
myconn.Open()
Dim mycmd As New System.Data.OleDb.OleDbCommand
mycmd.CommandText = "select * from A"
mycmd.Connection = myconn
Dim myada As New System.Data.OleDb.OleDbDataAdapter(mycmd)
Dim myda As New DataSet
myada.Fill(myda, "A")
DataGrid1.DataSource = myada.TableMappings("A")
我用vb 连接数据库,但是执行的时候总是在myconn.Open()和myada.Fill(myda, "A")这出错,我都用Imports System.Data
Imports System.Data.OleDb,这两个了,怎么还不行啊,高人指点一下吧,感激不尽!