Private times As Integer
Private Sub form_load()
times = 0
End Sub
Private Sub Command1_Click()
Dim i As Integer
Dim a As Integer
For i = 1 To Len(Text1.Text)
a = Asc(Mid(tex1.Text, i, 1))
If a < 65 Or (a > 90 And a < 97) Or a > 122 Then
MsgBox "输入的必须为英文字母"
Exit For
End If
Next i
If times >= 2 Then
MsgBox "您没有权限登录此系统"
Unload Me
End If
Adodc1.RecordSource = "select * from 数据 where username='" & Text1.Text & "'"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "没有这个用户,请重新输入正确的用户名", , "错误提示"
times = times + 1
Else
If Text2.Text = Adodc1.Recordset.Fields("password") Then
Form2.Show
Else
times = times + 1
MsgBox "你的密码错误,请输入正确的用户密码!", , "错误提示"
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
可是运行不了,哪位高手帮忙改改,非常感谢。。。。