You can show that you believe a database is safe and that its content can be trusted by adding a digital signature (digital signature: An electronic, encryption-based, secure stamp of authentication on a macro or document. This signature confirms that the macro or document originated from the signer and has not been altered.) to the database. This helps people who use the database decide whether to trust it and its content.
The process that you use to digitally sign a database depends on whether the database uses a Microsoft Office Access 2007 file format, such as an .accdb file, or an earlier format, such as an .mdb file. However, both processes require that you use a security certificate.
You can use a commercial security certificate, or you can create your own. This topic explains how to create your own security certificate.
In this article
Before you begin
To add a digital signature, you must first obtain or create a security certificate. Think of a security certificate as a pen that you use to digitally sign things, or a wax seal that only you can apply.
If you don't have a security certificate, you can create one by using the SelfCert tool (included with Microsoft Office).
Create a self-signed certificate
- In Microsoft Windows, click the Start button, point to All Programs, point to Microsoft Office, point to Microsoft Office Tools, and then click Digital Certificate for VBA Projects.
Browse to the folder that contains your Office Professional 2007 program files. The default folder is Drive:\Program Files\Microsoft Office\Office12. In that folder, locate and double-click SelfCert.exe.
The Create Digital Certificate dialog box appears.
- In the Your certificate's name box, type a name for the new test certificate.
- Click OK twice.
Note If you don't see the Digital Certificate for VBA Projects command, or you can't find SelfCert.exe, you might need to install SelfCert.
- Start your Office Professional 2007 Setup CD or other installation media.
- In Setup, click Add or Remove Features, and then click Continue.
Note If you work in an environment in which Office Professional 2007 is installed on individual computers by IT administrators rather than by CD, follow these steps:
- In Microsoft Windows, click the Start button, and then click Control Panel.
- Double-click Add or Remove Programs.
- Select 2007 Microsoft Office system, and then click Change.
- Click Add or remove features, and then click Continue.
- Continue with the following steps.
- Expand the Microsoft Office and Office Shared Features nodes by clicking the plus signs (+) next to them.
- Click Digital Certificate for VBA Projects.
- Click Run from My Computer.
- Click Continue to install the component.
You should only use SelfCert to create signatures for use within your own organization. If you want to digitally sign a database and then distribute that database commercially, you should obtain a commercial security certificate from a commercial certificate authority (CA). For more information, see the See Also section.
Package, sign, and distribute an Office Access 2007 database
Office Access 2007 makes it easy and fast to sign and distribute a database. When you create an .accdb file or .accde file, you can package the file, apply a digital signature to the package, and then distribute the signed package to other users. The Package and Sign tool places the database in an Access Deployment (.accdc) file, signs the file, and then places the signed package at a location that you determine. Users can then extract the database from the package and work directly in the database (not in the package file).
Remember these facts as you proceed:
- Packaging a database and signing the package is a way to convey trust. When you package and sign a database, your digital signature confirms that the database has not been altered after you created the package.
- After the database is extracted from the package, there is no longer a connection between the signed package and the extracted database.
- You can use the Package and Sign tool only with databases saved in an Office Access 2007 file format. Access 2007 also provides tools to sign and distribute databases that were created in an earlier file format. You must use the digital signature tool that is appropriate for the database file format that you are using.
- You can add only one database to a package.
- The process digitally signs a package that contains your entire database, not just macros or modules.
- The process compresses the package file to help reduce download times.
- You can extract databases from package files that are located on Windows SharePoint Services 3.0 servers.
The steps in the following sections explain how to create a signed package file and how to extract and use the database from a signed package file.
Create a signed package
- Open the database that you want to package and sign.
- Click the Microsoft Office Button , click Publish, and then click Package and Sign.
The Select Certificate dialog box appears.
- Select a digital certificate and then click OK.
The Create Microsoft Office Access Signed Package dialog box appears.
- In the Save in list, select a location for your signed database package.
- Enter a name for the signed package in the File name box, and then click Create.
Access creates the .accdc file and places it in the location that you chose.
Extract and use a signed package
- Click the Microsoft Office Button , and then click Open.
The Open dialog box appears.
- Select Microsoft Office Access Signed Packages (*.accdc) as the file type.
- Use the Look in list to locate the folder that contains your .accdc file, select the file, and then click Open.
- Do one of the following:
- If you chose to trust the security certificate that was used to sign the deployment package, the Extract Database To dialog box appears. Go to the next step.
- If you have not yet chosen to trust the security certificate, the following message appears.
If you trust the database, click Open. If you trust any certificate from that provider, click Trust all from publisher. The Extract Database To dialog box appears.
Note If you use a self-signed certificate to sign a database package and then click Trust all from publisher when you open that package, packages signed by using your self-signed certificates will always be trusted.
- Optionally, in the Save in list, select a location for the extracted database and then, in the File name box, enter a different name for the extracted database.
Tip If you extract the database to a trusted location, its contents will be automatically enabled whenever you open it. If you choose a non-trusted location, some database content may be disabled by default.
- Click OK.
If you are unsure of whether to trust a certificate, the article How to tell if a digital signature is trustworthy provides general information about checking the dates and other items in a certificate to help ensure that it is valid.
Top of Page
Digitally sign an earlier version database
Important The steps in this section do not apply to databases that use one of the new file formats.
For databases earlier than Office Access 2007, you can apply a digital signature (digital signature: An electronic, encryption-based, secure stamp of authentication on a macro or document. This signature confirms that the macro or document originated from the signer and has not been altered.) to the components in the database. A digital signature confirms that any macros, code modules, and other executable components in the database originated with the signer and that no one has altered them since the database was signed.
To apply a signature to your database, you first need a digital certificate. If you create databases for commercial distribution, you must obtain a certificate from a commercial certificate authority (CA). Certificate authorities do background checks to verify that the people who create content (such as databases) are reputable.
To learn more about certification authorities that offer services for Microsoft products, refer to the See Also section.
If you want to use a database for personal or limited workgroup scenarios, Microsoft Office Professional 2007 provides a tool for creating a self-signed certificate. The steps in the following sections explain how to install and use a tool called SelfCert.exe to create a self-signed certificate.
Code sign a database
Note Remember that these steps apply only when you are using databases in Office Access 2007 that use one of the earlier database file formats, such as an .mdb file. To sign newer databases, see the section Package, sign, and distribute an Office Access 2007 database.
- Open the database that you want to sign.
- On the Database Tools tab, in the Macro group, click Visual Basic to start the Visual Basic Editor.
Keyboard shortcut Press ALT+F11.
- In the Project Explorer window, select the database or Visual Basic for Applications (VBA) project that you want to sign.
- On the Tools menu, click Digital Signature.
The Digital Signature dialog box appears.
- Click Choose to select your test certificate.
The Select Certificate dialog box appears.
- Select the certificate that you want to apply.
If you followed the steps in the previous section, select the certificate that you created by using SelfCert.
- Click OK to close the Select Certificate dialog box, and click OK again to close the Digital Signature dialog box.
Tips for signing earlier version databases
- If you want to prevent users of your solution from accidentally modifying your VBA project and invalidating your signature, lock the VBA project before signing it.
Note Locking your VBA project doesn't prevent another user from replacing the digital signature with another signature. Corporate administrators might re-sign templates (template: A file or files that contain the structure and tools for shaping such elements as the style and page layout of finished files. For example, Word templates can shape a single document, and FrontPage templates can shape an entire Web site.) and add-ins (add-in: A supplemental program that adds custom commands or custom features to Microsoft Office.) so that they can control exactly what users may run on their computers.
- When you digitally sign a VBA project, consider obtaining a timestamp so that others can verify your signature even after the certificate used for the signature has expired. See Microsoft Office Online for more information about VBA security and timestamps.
Top of Page