打印

哪里有错误吗?为什么如何输入错误的 n都小于3?

哪里有错误吗?为什么如何输入错误的 n都小于3?

Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
txtsql = "select * from oper where 用户名='" & Trim$(Text1(0).Text) _
& "'" & " and 口令='" & Trim$(Text1(1).Text) + "'"
Set mrc = exesql(txtsql)
If mrc.RecordCount = 0 Then
n = n + 1
If n < 3 Then
MsgBox "没有这个用户,请从新确定密码跟用户名", vbOKOnly + vbExclamation, "信息提示"
Text1(0).Text = ""
Text1(1).Text = ""
Text1(0).SetFocus

Else
MsgBox "已经登录三次,退出系统", vbOKOnly + vbExclamation, "信息提示"
mrc.Close
Unload Me
End If
Else
userlevel = Trim(mrc.Fields("级别"))
mrc.Close
Unload Me
main.Show
End If
End Sub
哪里有错误吗?为什么如何输入错误的 n都小于3?

TOP

在过程外定义一个全局变量n,初始化为0

TOP

ok了哈哈

TOP