VB中想利用adodc控件和datagrid控件读取access数据库的一张表,提示出错

2025-01-19 23:13:27
推荐回答(1个)
回答1:

Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\BIBLIO.MDB;Persist Security Info=False"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from Authors"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
我试验的可以的,我用的是微软的例子数据库Biblio.mdb