ACC95: NewPassword Method Doesn't Update Current Session
ID: Q149219
|
The information in this article applies to:
SYMPTOMS
Advanced: Requires expert coding, interoperability, and multiuser skills.
After using the NewPassword method to change a user's password, the user
is unable to access objects for which he or she has permissions. The user
receives the error message "Not a valid account name or password."
RESOLUTION
There are two possible workarounds for this error message.
Workaround 1
You can avoid the error message by using the user interface to a change
password instead of the NewPassword method in Visual Basic for
Applications. Here are the basic steps:
- On the Tools menu, click Security.
- Click User and Group Accounts.
- Click the Change Logon Password tab.
- Enter a new password using the Old Password, New Password, and Verify
boxes, and then click OK.
Workaround 2
After you use the NewPassword method, you can restart Microsoft Access,
which allows you to log on using the new password. Because you have logged
on again, you do not receive the error message. To do so, follow these
steps:
- Exit Microsoft Access and restart the program.
- In the logon box, enter your new password and click OK.
MORE INFORMATION
Microsoft has confirmed this to be a problem in Microsoft Access version
7.0. We are researching this problem and will post new information here in
the Microsoft Knowledge Base as it becomes available.
Steps to Reproduce Behavior
- Start Microsoft Access and log in as Admin (or another user with
Administer permissions).
- On the Tools menu, click Security, and then click User and Group
Accounts. Create a new user, and let this user be a member of the
Admins group.
- Create the following new form:
Form: ChangePassword
-----------------------
Caption: ChangePassword
Textbox:
Name: OldPwd
ControlSource:
Textbox:
Name: NewPwd
ControlSource:
Change the captions of the corresponding labels of the text boxes to
Old and New.
Command button:
Name: Button0
Caption: My Button
OnClick: [Event Procedure]
Set the Onclick property to the following [Event Procedure]
Private Sub Command0_Click()
Dim ws as Workspace
Set ws = DBEngine.Workspaces(0)
ws.Users(CurrentUser()).NewPassword [OldPwd], [NewPwd]
ws.Close
End Sub
- Close and save the form.
- Quit Microsoft Access.
- Restart Microsoft Access and log in as the new user.
- Open the ChangePassword form.
- Enter the following into the text boxes:
Old: ""
New: abc
- Click the command button to update the password.
- Close the ChangePassword form.
- Open the Categories form. Note that the error message "Not a valid
account name or password" appears, and you are unable to open the form.
REFERENCES
Microsoft Access "Building Applications," version 7.0, Chapter 14,
"Securing and Delivering Your Application", pages 328-339.
Keywords : kberrmsg kbusage ScrtUsr
Version : 7.0
Platform : WINDOWS
Issue type : kbprb
|