xt = "") Then
MsgBox "没有输入用户名称,请重新输入!", vbOKOnly + vbExclamation, "警告"
UserName.SetFocus
Else '查询用户
Set rs = TransactSQL(SQL)
If iflag = 1 Then
If rs.EOF = True Then
msgBox "没有这个用户,请重新输入!",vbOKOnly + vbExclamation,"警告"
UserName.SetFocus
Else
If Trim(rs.Fields(1)) = Trim(PassWord.Text) Then
rs.Close
Me.Hide
gUserName = Trim(UserName.Text)'保存用户名称
FrmMain.Show
Unload Me
Else
MsgBox "密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
End If
End If
Else
Unload Me
End If
End If
pwdCount=pwdCount+1 '判断输入次数
If pwdCount = 3 Then
Unload Me
Exit Sub
End If
End Sub
Private Sub Form_Load()
pwdCount = 0
gUserName = ""
End Sub
Private Sub PassWord_KeyDown(KeyCode As Integer, Shift As Integer)
TabToEnter KeyCode
End Sub
Private Sub UserName_KeyDown(KeyCode As Integer, Shift As Integer)
&n