Unlike a Microsoft Access database, you can't secure forms, reports, or macros in an Microsoft Access project (.adp) by using user-level security. To secure form and report objects, you can hide the objects in the Database window or set startup options. To secure 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 secure access to macros in an Access project file, use startup options. You can secure a data access page by using file or folder security for your operating system. You can also secure your Visual Basic for Applications (VBA) code by converting your Access project file to an .ade file or by setting a password. And finally, if your Access project 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.
Show or hide database objects in the Database window
Specify whether a database object is hidden or visible
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.
Show 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.
Show or hide system objects by default
Microsoft Access automatically creates system objects when you create a new database.
Use 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.
For information about a specific item in the dialog box, click the question mark at the top of the dialog box, and then click the item.
Create a macro that runs when an Access file first opens
- Create a macro containing the actions you want to run when you open the database.
- 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.
Secure 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 secure 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 secure data access page files that are stored on an HTTP server, you must use the security features available on the server itself.
- Open Windows Explorer
or My Computer.
- 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.
- 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.
Secure Visual Basic for Applications code
You can protect the Visual Basic for Applications (VBA) code in your Microsoft Access project (.adp) by using a password or by saving a copy of your file as an .ade file. Saving your .adp file as an .ade file is more secure than password protecting your code. However, there are some limitations in using an .ade file.
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 protect the code by requiring a password.
- Open the Microsoft Access project (.adp) file or Microsoft Access database (.mdb) file that has the VBA code you want to protect.
- In the Database window, point to Macro on the Tools menu, and then click Visual Basic Editor.
Tip
You can also press ALT+F11.
- In the Microsoft Visual Basic Editor, click <Access database or Access project name> Project Properties on the Tools menu.
- 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 is protected.
- In the Password box, type your password.
Guidelines for passwords
User names can range from 1 to 20 characters, and can include letters, 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.
- 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.
Make an ADE file
Cautions
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 an 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 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 also 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.
- 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.
- On the Tools menu, click Database Utilities, and then click Make ADE File.
- 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.
- In the Save ADE As dialog box, specify a name, drive, and folder for the Access project.
Change the password of your 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.
- Open an Access project file or switch to the Database window for the open project.
- On the Tools menu, point to Security, and then click Set Login Password.
- In the Old Password box, type the current password.
- In the New Password box, type your password.
Guidelines for passwords
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.
- 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.