|
求助~把数据库转了SQL2000数据库后出错了
Private Sub cmdOK_Click()
Dim strSQL As String
If Nz(Me.txtUserName) = "" Then
MsgBox "请输入用户!", vbCritical, ""
Me.txtUserName.SetFocus
Exit Sub
End If
If Nz(Me.txtPassword) = "" Then
MsgBox "请输入密码!", vbCritical, ""
Me.txtPassword.SetFocus
Exit Sub
End If
If Len(Me.txtPassword) < 6 Then
MsgBox "密码不能少于6位!", vbCritical, ""
Me.txtPassword.SetFocus
Exit Sub
End If
If Nz(Me.txtConfirmPwd) = "" Then
MsgBox "请输入确认密码!", vbCritical, ""
Me.txtConfirmPwd.SetFocus
Exit Sub
End If
If Me.txtPassword <> Me.txtConfirmPwd Then
MsgBox "两次输入的密码不符,请重新输入!", vbCritical, ""
Me.txtPassword = ""
Me.txtConfirmPwd = ""
Me.txtPassword.SetFocus
Exit Sub
End If
If Nz(Me.cboPwdprompt) <> "" And Nz(Me.txtPromptAnswer) = "" Then
MsgBox "提示答案不能为空!", vbCritical, ""
Me.txtPromptAnswer.SetFocus
Exit Sub
End If
'将注册内容保存表用户表
If NewRecord = False Then DoCmd.RunCommand acCmdRecordsGoToNew
Me![FUserName] = Me.txtUserName
Me![FPassword] = RC4(Me.txtPassword) '密码加密后再保存
If Nz(Me.cboPwdprompt) <> "" Then Me![FPwdPrompt] = Me.cboPwdprompt
If Nz(Me.txtPromptAnswer) <> "" Then Me![FPromptAnswer] = (Me.txtPromptAnswer)
DoCmd.Save
'添加注册用户权限信息,所有窗体权限都被设为默认值0(不允许使用)
strSQL = "INSERT INTO usysRights ( FFormID, FUserID ) SELECT FFormID, " & Me![FUserID] & " FROM usysForms"
CurrentDb.Execute strSQL '(在这里提示出错了)
If Err = 0 Then
MsgBox "注册成功!" & vbCrLf & "目前您无权使用本系统中功能,请等待系统管理员审核!", vbInformation, ""
If FormIsLoaded("frmEntry") = True Then Forms("frmEntry")!cboUserName.Requery
DoCmd.Close
End If
End Sub
有老师在吗请看看
谢谢!
|
|