Create, change, or remove passwords (MDB)

Microsoft Office Access 2003

You can provide limited protection for your database by adding a password to restrict which users can open the database. Microsoft Access stores the database password in an unencrypted form. If this will compromise the security of sensitive data in the database, you should use user-level security instead of a database password.

Caution  

  • If you lose or forget your password, it can't be recovered, and you won't be able to open your database.
  • Do not use a database password if you will be replicating a database. Replicated databases can't be synchronized if database passwords are defined.
  • You can't set a database password if user-level security has been defined for your database and you don't have Administer permission for the database. Also, a database password is defined in addition to user-level security. If user-level security has been defined, any restrictions based on user-level security permissions remain in effect.
  1. Close the database. If this is a shared database, make sure all other users have closed the database.
  2. Make a backup copy of the database, and store it in a secure place.
  3. On the File menu, click Open.
  4. Click the arrow to the right of the Look In box, select the drive and folder where the Microsoft Access database (.mdb) is located, and then click the database's icon.
  5. Click the arrow to the right of the Open button, and then click Open Exclusive.
  6. On the Tools menu, point to Security, and then click Set Database Password.
  7. In the Password box, type your password.

    ShowGuidelines for passwords

    Use strong passwords that combine upper- and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Use a strong password that you can remember so that you don't have to write it down.

    User names can range from 1 to 20 characters, and can include alphabetic characters, accented characters, numbers, spaces, and symbols, with the following exceptions:

    • The characters " \ [ ] : | < > + = ; , . ? *
    • Leading spaces
    • Control characters (ASCII 10 through ASCII 31)

    Note  Passwords are case-sensitive.

  8. In the Verify box, confirm your password by typing the password again, and then click OK.

    The password is now set. The next time you or any other user opens the database, a dialog box will be displayed that requests a password.

Notes

  • A database password is stored with the database and not with the workgroup information file.
  • If a table from a password-protected database is linked, the password is cached (saved) in the database it is linked to when the link is established. This will allow anyone to see your data.

ShowSet a password in an Access project (.adp)

Unlike a Microsoft Access database, you can't help protect forms, reports, or macros in an Access project by using user-level security, nor can you set a password on the Microsoft Access project (.adp) file. To help protect form and report objects, you can hide the objects in the Database window or set startup options. To help protect access to the design of forms and reports in an Access project file, you can either set startup options or save your Access project file as an .ade file. To help protect access to macros in an Access project file, use startup options. You can help protect a data access page by using file or folder security for your operating system. You can also help protect you Visual Basic for Applications code by converting your Access project file to an .ade file or by setting a password.

ShowShow or hide database objects in the Database window

ShowSpecify whether a database object is hidden or visible

  1. Under Objects in the Database window, click the type of database object whose properties you want to change.
  2. Click Properties Button image on the Database toolbar.
  3. Select or clear the Hidden check box.

Note  In a Microsoft Access project, you cannot change the properties of a table, query, or database diagram because these objects reside in the Microsoft SQL Server database. However, you can change the properties of a form, report, macro, or module, because these objects reside in the Access project itself, not in the Microsoft SQL Server database. You can also change the properties of a data access page.

ShowShow or hide objects defined as hidden by default

If you need to work with objects that are defined as hidden without changing their status as hidden, you can display them in the Database window.

  1. On the Tools menu, click Options.
  2. Click the View tab.
  3. Under Show, select or clear the Hidden objects check box. Icons for hidden objects appear dimmed to distinguish them from objects that aren't defined as hidden.

ShowShow or hide system objects by default

Microsoft Access automatically creates system objects when you create a new database.

  1. On the Tools menu, click Options.
  2. Click the View tab.
  3. Under Show, select or clear the System objects check box.

ShowUse startup options

You can use startup options to specify, for example, what form to display, whether toolbars can be customized, and whether shortcut menus are available in your Microsoft Access file. You can also use a special macro named AutoExec to carry out an action or series of actions when your database first opens. When you open a database, Microsoft Access looks for a macro with this name and, if it finds one, runs it automatically.

Set startup options

  1. On the Tools menu, click Startup.
  2. Select the options or enter the settings you want to use.

ShowCreate a macro that runs when an Access file first opens

  1. Create a macro containing the actions you want to run when you open the database.
  2. Save the macro with the name AutoExec.

The next time you open the database, Microsoft Access runs this macro automatically.

Note  If you don't want to run the AutoExec macro when you open the database, hold down the SHIFT key when the database opens.

ShowHelp protect data access pages

Data access pages are Hypertext Markup Language (HTML) files that reference the data in a database. The data access pages aren't actually stored in the Microsoft Access file. For this reason, Access has no control over the security of the data access page files. To help protect a data access page that is stored on a local or network file system, assuming you have the appropriate permissions, you can use the following procedure.

Note  To help protect data access page files that are stored on an HTTP server, you must use the security features available on the server itself.

  1. Open Windows Explorer File button or My Computer.
  2. Locate the folder where the data access page's HTML file is located. By default, the file will be located in the same directory as your Access database.
  3. Right-click the data access page (.htm) file or the folder containing the file, click Properties on the shortcut menu, and then select the Read-only check box.

ShowHelp protect Visual Basic for Applications code

You can help protect the VBA code in your Microsoft Access project (.adp) using a password or by saving a copy of your file as an .ade file. Saving your .adp file as an .ade file provides greater security than password protecting your code. However, there are some limitations in using an .ade file.

ShowHelp protect Visual Basic for Applications code with a password

To prevent someone from viewing or making changes to your Microsoft Visual Basic for Applications (VBA) code, you can help protect the code by requiring a password.

  1. Open the Microsoft Access project (.adp) file or Microsoft Access database (.mdb) file that has the VBA code you want to help protect.
  2. In the Database window, point to Macro on the Tools menu, and then click Visual Basic Editor.

    ShowTip

    You can also press ALT+F11 to open the Visual Basic Editor.

  3. In the Visual Basic Editor, click <Access database or Access project name> Project Properties on the Tools menu.
  4. On the Protection tab, select the Lock project for viewing check box. If you set a password but don't select Lock project for viewing, the code can be viewed and edited by anyone, but the Project Properties dialog box continues to employ its security features.
  5. In the Password box, type your password.

    ShowGuidelines for passwords

    Use strong passwords that combine upper- and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Use a strong password that you can remember so that you don't have to write it down.

    User names can range from 1 to 20 characters, and can include alphabetic characters, accented characters, numbers, spaces, and symbols, with the following exceptions:

    • The characters " \ [ ] : | < > + = ; , . ? *
    • Leading spaces
    • Control characters (ASCII 10 through ASCII 31)

    Note  Passwords are case-sensitive.

  6. In the Confirm password box, confirm your password by typing the password again, and then click OK.

    The password is now set. The next time you or any other user opens the database, a dialog box will be displayed that requests a password.

    Important  If you forget your password, it can't be recovered, and you won't be able to view or edit the VBA code.

ShowMake an ADE file

Caution

Be sure to save a copy of your original Microsoft Access project (.adp) file.

  • You can't modify the design of forms, reports, or modules in a Access project file saved as an .ade file. If you need to change the design of these objects, you must do so in the original Access project file and then resave the Access project file as an .ade file.
  • You can't create an .ade file in Access 2002 or later from an Access project file created in an earlier version. You can only save an .ade file from an Access project file from the same version of Access.
  • You won't be able to convert an Access project file saved as an .ade file in future versions of Microsoft Access. You will be able to run the .ade file in a later version of Access.
  1. Close the Access project file. If you are working in a multiuser environment, make sure that all other users have closed the Access project file.
  2. On the Tools menu, click Database Utilities, and then click Make ADE File.
  3. In the Database To Save As ADE dialog box, specify the Access project file you want to save as an .ade file, and then click Make ADE.
  4. In the Save ADE As dialog box, specify a name, drive, and folder for the Access project.

ShowRemove a database password in an Access database

  1. On the File menu, click Open.
  2. Click the arrow to the right of the Open button, click Open Exclusive, and then open the database.
  3. In the Password Required dialog box, type the database password, and then click OK. Passwords are case-sensitive.
  4. On the Tools menu, point to Security, and then click Unset Database Password. This command is only available if a database password was set previously.
  5. In the Unset Database Password dialog box, type your current password.

ShowCreate or change a security account password in an Access database

A security account password is created to make sure that no user can log on using another user name. By default, Microsoft Access assigns a blank password to the Admin user account, and to any new user accounts you create in your workgroup.

Caution  You can't recover your password if you forget it, so be sure to store it in a safe place. If you forget your password, a user logged on with an administrator account (a member of the Admins group in the workgroup in which the account and password were created) must clear the password before you can log on.

  1. Start Microsoft Access by using the workgroup the user account is stored in, and log on using the name of the account for which you want to create or change the password.

    You can find out which workgroup is current or change workgroups by using the Workgroup Administrator.

  2. Open a database.
  3. On the Tools menu, point to Security, and then click User and Group Accounts.
  4. On the Change Logon Password tab, leave the Old Password box blank if a password hasn't been defined previously for this account. Otherwise, type the current password in the Old Password box.
  5. Type the new password in the New Password box.

    ShowGuidelines for passwords

    Use strong passwords that combine upper- and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Use a strong password that you can remember so that you don't have to write it down.

    User names can range from 1 to 20 characters, and can include alphabetic characters, accented characters, numbers, spaces, and symbols, with the following exceptions:

    • The characters " \ [ ] : | < > + = ; , . ? *
    • Leading spaces
    • Control characters (ASCII 10 through ASCII 31)

    Note  Passwords are case-sensitive.

  6. Retype the password in the Verify box, and then click OK.

ShowChange a password in an Access project

If your Microsoft Access project (.adp) is connected to a Microsoft SQL Server 6.5 (or later) database with SQL Server security implemented, then you can change the logon password from within Access.

  1. Open an Access project file or switch to the Database window for the open project.
  2. On the Tools menu, point to Security, and then click Set Login Password.
  3. In the Old Password box, type the current password.
  4. In the New Password box, type your password.

    ShowGuidelines for passwords

    Use strong passwords that combine upper- and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Use a strong password that you can remember so that you don't have to write it down.

    User names can range from 1 to 20 characters, and can include alphabetic characters, accented characters, numbers, spaces, and symbols, with the following exceptions:

    • The characters " \ [ ] : | < > + = ; , . ? *
    • Leading spaces
    • Control characters (ASCII 10 through ASCII 31)

    Note  Passwords are case-sensitive.

  5. In the Verify box, confirm your password by typing the password again, and then click OK.

    The password is now changed and Access resets the .adp connection with the new password information. The next time you or any other user opens the project, a dialog box will be displayed that requests the new password.

Important  If you lose or forget your password, it can't be recovered, and you won't be able to open your project.

ShowClear a security account password

To complete this procedure, you must be logged on as a member of the Admins group.

  1. Start Microsoft Access by using the workgroup information file in which the user account is stored.

    You can find out which workgroup information file is current or change workgroups by using the Workgroup Administrator.

  2. Open a database.
  3. On the Tools menu, point to Security, and then click User and Group Accounts.
  4. On the Users tab, enter the user account name in the Name box.
  5. Click Clear Password.
  6. Repeat steps 4 and 5 to clear any additional passwords, and then click OK when you have finished.

ShowHelp protect Microsoft Visual Basic for Applications (VBA) code with a password

To prevent someone from viewing or making changes to your Microsoft Visual Basic for Applications (VBA) code, you can help protect the code by requiring a password.

  1. Open the Microsoft Access project (.adp) file or Microsoft Access database (.mdb) file that has the VBA code you want to help protect.
  2. In the Database window, point to Macro on the Tools menu, and then click Visual Basic Editor.

    ShowTip

    You can also press ALT+F11 to open the Visual Basic Editor.

  3. In the Microsoft Visual Basic Editor, click <Access database or Access project name> Project Properties on the Tools menu.
  4. On the Protection tab, select the Lock project for viewing check box. If you set a password but don't select Lock project for viewing, the code can be viewed and edited by anyone, but the Project Properties dialog box continues to employ its security features.
  5. In the Password box, type your password.

    ShowGuidelines for passwords

    Use strong passwords that combine upper- and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Use a strong password that you can remember so that you don't have to write it down.

    User names can range from 1 to 20 characters, and can include alphabetic characters, accented characters, numbers, spaces, and symbols, with the following exceptions:

    • The characters " \ [ ] : | < > + = ; , . ? *
    • Leading spaces
    • Control characters (ASCII 10 through ASCII 31)

    Note  Passwords are case-sensitive.

  6. In the Confirm password box, confirm your password by typing the password again, and then click OK.

    The password is now set. The next time you or any other user opens the database, a dialog box will be displayed that requests a password.

    Important  If you forget your password, it can't be recovered, and you won't be able to view or edit the VBA code.