Introduction - If you have any usage issues, please Google them yourself
Private Sub cancel_Click()
Unload Me
End Sub
Private Sub login_Click()
Static Count As Integer
Dim sqlstr As String
sqlstr = "select* from userinfo where [user]= " & nametext & " "
Adodc1.RecordSource = sqlstr
Adodc1.Refresh
If Adodc1.Recordset.BOF Then
MsgBox "用户名错误,重新输入", vbExclamation, "警告"
nametext.Text = ""
nametext.SetFocus
Else
If Trim(Adodc1.Recordset.Fields("pass")) = Trim(passtext) Then
mainMDIfrm.Show
Me.Hide
Else
MsgBox "密码错误,重新输入", vbExclamation, "警告"
passtext.Text = ""
passtext.SetFocus
End If
End If
Count = Count+ 1
If Count = 3 Then Unload Me
End Sub