[求助]连接错误
Private Sub admin_Click()
Dim rec As New ADODB.Recordset
Dim name As String
Dim pwd As String
Dim a_name As String
Dim a_pwd As String
a_name = CStr(admin_name.Text)
a_pwd = CStr(admin_pwd.Text)
name = "select * from admin where admin_name='&a_name &' "
rec.Open ' 提示这错误 实时错误'3709' 无法执行此连接
If a_name = "" Then
MsgBox ("请输入用户名!")
ElseIf rec.RecordCount <> name Then
MsgBox ("用户名错误!")
ElseIf a_pwd = "" Then
MsgBox ("请输入密码!")
End If
End Sub
Private Sub fadmin_Load()
Dim con As New ADODB.Connection
Dim path As String
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.path & "\database\db.mdb "
con.Open
End Sub