ACC95: NewPassword Method Doesn't Update Current Session

Last reviewed: May 23, 1997
Article ID: Q149219
The information in this article applies to:
  • Microsoft Access version 7.0

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:

  1. On the Tools menu, click Security.

  2. Click User and Group Accounts.

  3. Click the Change Logon Password tab.

  4. 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:

  1. Exit Microsoft Access and restart the program.

  2. 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

  1. Start Microsoft Access and log in as Admin (or another user with Administer permissions).

  2. 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.

  3. 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" (without the quotation marks).
    
          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
    
    

  4. Close and save the form.

  5. Quit Microsoft Access.

  6. Restart Microsoft Access and log in as the new user.

  7. Open the ChangePassword form.

  8. Enter the following into the text boxes:

          Old: ""  (with no spaces between the quotation marks)
          New: abc
    

  9. Click the command button to update the password.

  10. Close the ChangePassword form.

  11. 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
Hardware : X86
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 23, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.