If Text1 = "" Then
MsgBox "请输入用户名"
Text1.SetFocus
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "请输入密码"
Text2.SetFocus
Exit Sub
End If
Form1.Adodc.RecordSource = " select * from S_U WHERe Username='" & Trim(Text1) & "'"
Adodc.Refresh
If Adodc.Recordset.EOF = True Then
MsgBox "用户名不存在"
If trytimes >= 3 Then
MsgBox "已尝试3次,系统关闭"
End
Else
Exit Sub
End If
End If
If Trim(Adodc.Recordset.Fields("password")) <> Trim(Text2) Then
MsgBox "密码错误"
trytimes = trytimes + 1
Text2.SelStart = 0
Text2.SelLength = Len(Text2)
Text2.SetFocus
If trytimes >= 3 Then
MsgBox "已尝试3次,系统关闭"
End
Else
Exit Sub
End If
Else
strUserName = Trim(Text1)
Unload Me
End If
求助。。已经卡住N天了,到底哪里错了