B
bigturnip
I am banging my head against a brick wall here, probably a simpl
answer, I have the following code and know that it works except I don'
know how to set UsrPwd to the current user. I can use .createuser an
the rest of the code then works, but I don't want to create a new use
and the CurrentUser method gives a type mismatch.
I am using Access 2002 on Windows XP and the DAO 3.6 object library.
Any help would be appreciated.
Sub ChangePassword()
Dim wrkspc As Workspace
Dim UsrPwd As User
Dim strPasswordOld As String
Dim strPassword As String
Dim strPasswordConfirm As String
' Get default workspace.
Set wrkspc = DBEngine.Workspaces(0)
Set UsrPwd =
With wrkspc
strPasswordOld = InputBox("Enter old password")
strPassword = InputBox("Enter new password")
strPasswordConfirm = InputBox("Confirm new password")
If LCase(strPassword) <> LCase(strPasswordConfirm) Then
MsgBox "New Password did not match"
Exit Sub
End If
Select Case Len(strPassword)
Case 1 To 14
UsrPwd.newpassword strPasswordOld, LCase(strPassword)
MsgBox "Password changed!"
Case Is > 14
MsgBox "Password too long!"
Case 0
End Select
End With
End Sub
answer, I have the following code and know that it works except I don'
know how to set UsrPwd to the current user. I can use .createuser an
the rest of the code then works, but I don't want to create a new use
and the CurrentUser method gives a type mismatch.
I am using Access 2002 on Windows XP and the DAO 3.6 object library.
Any help would be appreciated.
Sub ChangePassword()
Dim wrkspc As Workspace
Dim UsrPwd As User
Dim strPasswordOld As String
Dim strPassword As String
Dim strPasswordConfirm As String
' Get default workspace.
Set wrkspc = DBEngine.Workspaces(0)
Set UsrPwd =
With wrkspc
strPasswordOld = InputBox("Enter old password")
strPassword = InputBox("Enter new password")
strPasswordConfirm = InputBox("Confirm new password")
If LCase(strPassword) <> LCase(strPasswordConfirm) Then
MsgBox "New Password did not match"
Exit Sub
End If
Select Case Len(strPassword)
Case 1 To 14
UsrPwd.newpassword strPasswordOld, LCase(strPassword)
MsgBox "Password changed!"
Case Is > 14
MsgBox "Password too long!"
Case 0
End Select
End With
End Sub