vb与ACCESS连接问题
请大家看一下我的代码,哪儿出错了?On Error GoTo err
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim str As String
str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\data\mydb.mdb;Persist Security Info=False"
cn.Open str
rs.Open "select pwd from table1 where user=admin"
Set DataGrid1.DataSource = rs '把记录集的记录显示到DataGrid1
Exit Sub
err:
MsgBox err.Description
帮帮忙。