Access VBA中编译错误:子程序或函数未被定义是怎么回事?
Private Sub ok_Click()
On Error GoTo Err_OK_Click
Dim strSQL As String
Dim rs As New ADODB.Recordset
If IsNull(Me.UserName) Or Me.UserName = "" Then
DoCmd.Beep
MsgBox ("请输入登录人!")
ElseIf IsNull(Me.Password) Or Me.Password = "" Then
DoCmd.Beep
MsgBox ("请输入密码!")
Else
strSQL = "SELECT * FROM 登陆 WHERE 登陆人='" & Me.UserName & "' and 密码='" & Me.Password & "'"
Set rs = GetRs(strSQL)
If rs.EOF Then
DoCmd.Beep
MsgBox ("登陆人或者密码错误!")
Me.UserName = ""
Me.Password = ""
Me.UserName.SetFocus
Exit Sub
Else
DoCmd.close
check = True
DoCmd.OpenForm ("主窗体")
End If
End If
Set rs = Nothing
Exit_OK_Click:
Exit Sub
Err_OK_Click:
MsgBox (Err.Description)
Debug.Print Err.Description
Resume Exit_OK_Click
End Sub
请问是哪里错了嘛??请帮帮忙,谢谢,这个是搞登陆功能的。
[解决办法]
GetRs在哪里?
[解决办法]
跑了下
就是缺少GetRs函数
[解决办法]
GetRs(strSQL)
自己写的吧=GetRecordSet()?