先增加引用--》microsoft activex data objects 2.0 library
Dim adoCmm As New ADODB.Command
Dim adoRec As New ADODB.Recordset
adoCnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\vb\2\news.mdb;Persist Security Info=False"
adoCmm.ActiveConnection = adoCnn
adoCmm.CommandType = adCmdText
adoCmm.CommandText = "select * from employees"
Print "连接数据库成功"
Trackback: http://tb.donews.net/TrackBack.aspx?PostId=931203