Access Tools  «Prev  Next»

Lesson 5 Encrypting and decrypting a database
Objective Encrypt and Decrypt an Access Database and identify the Reasons to use Encryption.

Encrypt and Decrypt an Access Database and identify the Reasons to use Encryption

There are times when you might want to protect the data in your application beyond what Access security options can do. Encrypting your database protects it from being exported for use in other programs or applications. With encryption, users of your database can access your data in your application only, but they cannot take the data out to use elsewhere. Encrypting a database is actually quite straightforward. Before showing how to encrypt a database, see what the Consulting407.mdb database looks like before being encrypted when you examine it with Wordpad.exe. You will be able to read all of the data:

Consulting407.mdb database unencrypted view in Wordpad

To encrypt a database, do not open it first:
  1. From Tools menu choose Security, then Encrypt/Decrypt Database.
  2. The first dialog opened will ask you which database to encrypt/decrypt. Choose the database and click OK.
  3. Next you will be asked what database to create. Fill in the name of the database you want to create and click OK.
After the database has been encrypted, if you try to examine it by using Wordpad.exe again, it will look like the following image:

Consulting407.mdb database encrypted view in Wordpad

For added protection, combine encryption with the use of one of the security methods discussed earlier. Security limits who can use your database, while encryption limits users from taking your data away. After you have encrypted the database, if you decide you want to decrypt it, follow the same steps as encrypting (above), but select the already encrypted database. Access will recognize that it is encrypted and will decrypt it.

Performance cost of encrypting your Database

While using the encryption feature of Access helps to keep others from examining your database, there is a cost involved. The cost in this case is a 35% hit in performance. So make sure it is absolutely necessary to encrypt a database before doing so.
If you want to protect your secured database from unauthorized access by someone who is using a disk editor or other utility program, you can encrypt it. Encryption makes a database indecipherable, which protects it from unauthorized viewing or use, particularly during electronic transmission or when it's stored on floppy disk, tape, or compact disc. Encrypting an unsecured database will have no effect because anybody can open the database with Access or VBA and gain full access to all objects in the database.
When you want to help prevent unauthorized use of an Access database, consider encrypting the database by setting a password. If you know the password for an encrypted database, you can also decrypt the database and remove its password. This article explains how to encrypt a database by using a database password, and how to decrypt a database and remove its password.
In earlier versions of Access, you could create user accounts and passwords using a feature called user-level security. This topic does not discuss user-level security, which is not available when you use the .accdb file format. For more information, see the See Also section.
If you encrypt a database and then lose the password, you will be unable to use the database. You cannot remove a database password if you do not know the password.

Overview of encryption Tool

The encryption tool makes your data unreadable by other tools, and sets a password that is required to use the database. Remember these rules as you proceed: The new encryption feature applies only to databases in the .accdb file format. The tool uses a stronger encryption algorithm than was used in earlier versions of Access. If you want to encode or apply a password to an earlier-version Access database (an .mdb file), Access uses the Encoding and Password features from Access 2003.
The steps in this section explain how to create and apply a password to an Access 2007 database.

Encrypt a Database

1.Open the database in Exclusive mode. ShowHow do I open a database in Exclusive mode?
Button image
2.On the Database Tools tab, in the Database Tools group, click Encrypt with Password.
The Set Database Password dialog box appears.
Note: Use strong passwords that combine uppercase and lowercase letters, numbers, and symbols.
Weak passwords don't mix these elements.
  1. Strong password: Y6dh!et5.
  2. Weak password: House27.
Passwords should be 8 or more characters in length. A pass phrase that uses 14 or more characters is better. For more information, see Help protect your personal information with strong passwords. It is critical that you remember your password. If you forget your password, Microsoft cannot retrieve it. Store the passwords that you write down in a secure place away from the information that they help protect.

Encrypt a split database

To encrypt a split database, you encrypt both the front-end database and the back-end database. After you encrypt the back-end database, you relink to its tables.
  1. Using the steps provided in the section Encrypt a database by using a password, encrypt the back-end database.
  2. In the front-end database, delete the links to the tables in the back-end database, and then link to them again.
    Access will prompt you for the back-end database password when you relink.
  3. After you relink the tables, encrypt the front-end database by using the steps provided in the section Encrypt a database by using a password.

Open and decrypt a database

As a reminder, it is critical that you remember your password, if you forget your password, there is no method by which it can be retrieved.

Decrypt a database

  1. Open the encrypted database the way that you open any other database. The Password Required dialog box appears.
  2. Type your password in the Enter database password box, and then click OK.

Remove a password from a database

When you remove a password from a database, you can restore it at any time (or replace it with another password) by repeating the steps in Encrypt a database by using a password, earlier in this article.

Remove a password

  1. Open the database in Exclusive mode.
  2. On the Database Tools tab, in the Database Tools group, click Decrypt Database. The Unset Database Password dialog box appears.
  3. Type your password in the Password box, and then click OK.

In the next lesson, we'll take a look at the wonderful world of Replication.