Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: How to Clear the Last User Name from the Logon Dialog Box


View products that this article applies to.

This article was previously published under Q203887
Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies only to a Microsoft Access database (.mdb).

↑ Back to the top


Summary

When you start Microsoft Access in a secured database environment, you are prompted by the Logon dialog box to log on to the database before you can open it. The Name box in the Logon dialog box is populated with the name of the last user who logged on to the database. This article demonstrates a method to prevent the last user name from appearing in the Name box.

↑ Back to the top


More information

With any Access database, Microsoft Access stores the name of the last user to have accessed the database in the Windows registry. When you implement Access Security, the name of the last user appears in the Logon dialog box whenever the database is opened.

To prevent the last user's name from appearing in the Name box of the Logon dialog box, create a shortcut that includes the /user switch, but which does not include the name of a user. For an example of how to do this, follow these steps. This example assumes that Northwind.mdb is the secured database, and it creates a shortcut based on this assumption.
  1. Right-click the Windows desktop where you intend to open and use your secured Microsoft Access database.
  2. Point to New, and then click Shortcut.
  3. On the first page of the Create Shortcut Wizard, type the following command line, and then click Next:
    "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb" /user
  4. On the second page, type Northwind 2000, and then click Finish.
  5. Double-click the new shortcut. Note that the Name box in the Logon dialog box is blank.
NOTE: Although there are Application Programming Interface (API) calls that can be made to the Windows registry for performing such tasks as opening a registry key, reading the key's value, and modifying its value, the timing at which this is done within an Access database causes the results of the API calls to be unsuccessful. The API calls are unsuccessful for two reasons:
  • The API code within the database cannot be run until you have successfully opened the database.
  • Access updates the Last User registry key immediately at the point at which Access closes (after all database code has finished running, including API code).

↑ Back to the top


References

For additional information about Access security, click the article numbers below to view the articles in the Microsoft Knowledge Base:
254372� ACC2000: Overview of How to Secure a Microsoft Access Database
235961� ACC2000: Microsoft Access Security Manager Add-In Available in Download Center
207793� ACC2000: Microsoft Access Security FAQ Available in Download Center

↑ Back to the top


Keywords: KB203887, kbhowto

↑ Back to the top

Article Info
Article ID : 203887
Revision : 2
Created on : 6/28/2004
Published on : 6/28/2004
Exists online : False
Views : 343