Private Sub CmdOK_Click()
Dim RsUserID As New ADODB.Recordset
Set RsUserID = Cnn.Execute("select * from SysUser where sysuserid='" & Trim(TxtUserName.Text) & "'")
If LoginTimes > 3 Then
MsgBox "你已经输入系统三次了,你不是本系统的用户,请不要再试了。"
End
End If
If RsUserID.EOF Then
LoginTimes = LoginTimes + 1
MsgBox "没有这个用户!", vbExclamation, "美容专家连锁店管理系统"
Exit Sub
Else
RsUserID.Find "Password='" & Trim(TxtPassword.Text) & "'"
If RsUserID.EOF Then
MsgBox "你的密码错误,请重新输入!", vbExclamation, "美容专家连锁店管理系统"
LoginTimes = LoginTimes + 1
Exit Sub
Else
MDIFrmMain.Show
Unload Me
End If
End If
End Sub
Private Sub Form_Load()
LoginTimes = 0
End Sub
Private Sub TxtPassword_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
CmdOK_Click
End If
End Sub
Private Sub TxtUserName_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtPassword.SetFocus
End If
End Sub