高手们我的程序错在那里啊?
Option Compare DatabasePrivate Sub cm1_Click()
Dim rs As New ADODB.Recordset
Dim str As String
Dim logname As String
Dim pwd As String
logname = Me.wb1.Value
pwd = wb2.Value
If IsNull(logname) Then
DoCmd.Beep
MsgBox ("请输入用户名")
ElseIf IsNull(pwd) Then
DoCmd.Beep
MsgBox ("请输入密码")
Else
Dim sqlstr As String
sqlstr = "select * from 注册表 where ID="& logname & "and PASSWORD="& pwd "
rs.Open sqlstr, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
If rs.EOF Then
DoCmd.Beep
MsgBox ("没有这个用户,请前去注册")
wb1.Text = ""
wb2.Text = ""
wb1.SetFocus
Exit Sub
Else
DoCmd.Beep
MsgBox ("欢迎进入成绩管理系统")
End If
End If
End Sub
高手指点一下啊,偶还是一菜鸟,谢谢拉