Microsoft KB Archive/292302

= ACC2002: Can't Use /Pwd Option with Password-Protected Database =

Article ID: 292302

Article Last Modified on 11/6/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q292302



Moderate: Requires basic macro, coding, and interoperability skills.

For a Microsoft Access 2000 version of this article, see 207891.



SYMPTOMS
When you try to start Microsoft Access by using the /pwd command-line option to open a database that is password-protected, the Logon dialog box is displayed, even if you supply the correct password.



CAUSE
The /pwd option is used to provide the user-level security account password, not the database password.



RESOLUTION
In order to use the /pwd command-line option to start Microsoft Access, implement User-Level Security.



MORE INFORMATION
Microsoft Access offers two ways to protect a database with a password:
 * Database password - to control who can open a database.
 * Security Account password - to verify users when they log on to a workgroup.

The database password can prevent unauthorized users from opening a particular database. When you set a database password, all users must type that password before they can open the database. However, after the database is open, there are no security restrictions on what operations a user can perform in that database.

The Security Account password is used when you define user-level security for a workgroup. With user-level security, you must type a username and a password to open a database. After the database is open, your username determines the type of access you have to each object in the database.

When you use the /pwd command-line option, it always applies to a Security Account password.

You may also see this behavior if you are using user-level security and you do not supply the correct user-level password. In this case as well, you do not receive an error message.

IMPORTANT: Make sure you are using the correct case as well. If, for example, you have assigned the password &quot;oneSock&quot; to yourself, and you then try to use the password &quot;onesock&quot; with the /pwd command-line option, Access prompts you for the password; you do not receive an error.

Steps to Reproduce the Behavior
 Open the sample database Northwind.mdb for exclusive access. On the Tools menu, point to Security, and then click Set Database password. Type Northwind in the Password box and in the Verify box. Click OK to close the Set Database Password dialog box. Close the database, and then quit Microsoft Access.</li> Start Microsoft Access with command-line options to open the Northwind database and send the password. To do so, follow these steps. Note that the command line in the following example uses the default installation path for Microsoft Access files; substitute the path to Msaccess.exe and Northwind.mdb on your hard disk. <ol style="list-style-type: lower-alpha;"> Click Start, and then click Run.</li> In the Run dialog box, type the following line in the Open box, and then click OK:

&quot;C:\program files\microsoft office\office10\msaccess.exe&quot; &quot;c:\program files\microsoft office\office10\samples\northwind.mdb&quot; /pwd northwind

</li></ol> </li> Note that Microsoft Access displays the user-level security Logon dialog box even though you provided the database password on the command line.</li></ol>

To remove the database password from the Northwind database, follow these steps:
 * 1) Open the sample database Northwind.mdb for exclusive access.
 * 2) In the Password Required dialog box, type Northwind, and then click OK.
 * 3) On the Tools menu, point to Security, and then click Unset Database Password.
 * 4) Type Northwind in the Password box, and then click OK.
 * 5) Close the database, and then quit Microsoft Access.

<div class="references_section">