紧急求助
Dim con As New ADODB.ConnectionPrivate Sub admin_Click()
Dim str As String
str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\database\db.mdb "
con.Open str
Dim rec As New ADODB.Recordset
Dim t_name As String '得到输入框的用户名
Dim t_pwd As String '得到输入框的密码
Dim a_name As String '得到后台的用户名
Dim a_pwd As String '得到后台的密码
t_name = CStr(Trim(tex_name.Text)) '把输入框中的用户名给t_name
t_pwd = CStr(tex_pwd.Text) '把输入框中的密码给t_pwd
a_name = "select * from admin where admin_name='" & t_name & "'"
rec.ActiveConnection = con
rec.Open a_name
If t_name = "" Then
MsgBox ("请输入用户名!")
ElseIf rec.RecordCount <= 0 Then '这为什么打不开?
MsgBox ("用户名错误!")
End If