一个简单的登录代码,我用ACCESS做数据库时没问题,但换成SQL2000后 代码一样 每次点击登录时只能判断到用户名,密码我输入正确的他也提示错误晕死!请问为什么?是不是SQL2000我建表时数据类型不对?
代码如下:
Private Sub cmdDL_Click()
Static miCount As Integer
If txtUserName = "" Then
  MsgBox "用户名不能为空,请重输入!", vbExclamation + vbOKOnly, "系统提示!"
  txtUserName.SetFocus
   Exit Sub
End If txtSQL = "select * from User_Info where User_Name='" & txtUserName & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF Then
MsgBox "用户名不正确,请重新输入!", vbExclamation + vbOKOnly, "系统提示!"
txtUserName = ""
txtPassword.Enabled = False
txtUserName.SetFocus
Exit Sub
Else
txtPassword.Enabled = True
End IfIf txtPassword <> "" Then
Debug.Print (mrc.Fields("User_Password"))
If mrc.Fields("User_Password") <> txtPassword Then
MsgBox "密码错误,请重新输入!", vbExclamation + vbOKOnly, "系统提示!"
txtPassword = ""
txtPassword.SetFocus
  miCount = miCount + 1
    If miCount >= 3 Then
     MsgBox "无权操作本系统!再见!", vbOKOnly + vbExclamation, "警告"
     End
   End If
Else
frmMainMDI.Show
Unload frmLogin
End If
Else
End IfIf txtUserName <> "" Then
txtPassword.SetFocus
Exit Sub
End If
End Sub