|
请指正下面两段登陆程序分别有什么问题,并改正,谢谢!
(1)
If IsNull(用户名) = False Then
Dim rst As New ADODB.Recordset
Dim strSQL As String
strSQL = "SELECT 密码 FROM 用户权限表 WHERE 用户名 = " & Me.用户名
rst.Open strSQL, CurrentProject.Connection, adOpenStatic
If rst.RecordCount > 0 Then
If rst("密码") = Me.密码 Then
DoCmd.Close acForm, "登录"
DoCmd.OpenForm "主窗体"
End If
Else
…………
End If
程序提示说至少有一个参数未定义
(2)
If IsNull(用户名) = False Then
If DLookup("[密码]", "用户权限表", "[用户名] =" & Me.用户名) = Me.密码 Then
DoCmd.Close acForm, "登录"
DoCmd.OpenForm "主窗体"
Else
…………
dlookup函数不太会用,请帮忙改正! |
|