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.
- Right-click the Windows desktop where you intend to open and use your secured Microsoft Access database.
- Point to New, and then click Shortcut.
- 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
- On the second page, type Northwind 2000, and then click Finish.
- 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).