高手看下这段登录窗口的源码,哪里出错了?
Private Sub Command1_Click()Static micount As Integer
Dim sqlstr As String
sqlstr = "select * from登录where用户名= '" & Text1 & "'"
Adodc1.RecordSource = sqlstr
Adodc1.Refresh
If Adodc1.Recordset.BOF Then
MsgBox "用户名错误,重新输入", vbExclamation, "警告"
Text1 = ""
Text1.SetFocus
Else
If Adodc1.Recordset.Fields("密码") = Text2 Then
form2.Show
Unload Me
Else
MsgBox "密码错误,重新输入", vbExclamation, "警告"
Text2.Text = ""
Text2.SetFocus
End If
End If
micount = micount + 1
If micount = 3 Then Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub