Encrypting and Decrypting a Database

Before we move on to the more sophisticated methods of securing a database, it is important that you understand what any method of security does and does not provide for you. No matter how well you learn about and implement the techniques in this section, you will not be protected against someone attempting to read the data contained in a database. Even after you secure a database, someone with a disk editor can view the contents of the file. Although the data in the file will not appear in an easy-to-read format, the data is there and available for unauthorized individuals to see.

You might be feeling discouraged and asking why you should bother with security. Do not despair! Access enables you to encrypt a database, rendering the data in the database indecipherable in word processors, disk utilities, and other products that are capable of reading text. When a database is encrypted, it is difficult to decipher any of its data.

The database you are encrypting cannot be open. To encrypt a database using Access's standard menus, follow these steps:

  1. Choose Tools | Security | Encrypt/Decrypt Database. The Encrypt/Decrypt Database dialog box appears.

  2. In the Encrypt/Decrypt Database dialog box, select the file you want to encrypt and then click OK. Access prompts you for the name of the encrypted database.

  3. If you select the same name as the existing file, Access deletes the original decrypted file after it determines that the encryption process is successful.


You cannot encrypt a database to itself if it is open. You must first close the database and then select Tools | Security | Encrypt/Decrypt Database.


It is always a good idea to back up the original database before you begin the encryption process. This ensures that if something goes awry during the encryption process, you won't lose data.

When you encrypt a database, Access encrypts the entire database?not just the data. As you access the data and the objects in the database, Access needs to decrypt the objects so that users can use them. When users are finished accessing the objects, Access encrypts them again. Regardless of the method of encryption you use, the encrypted database degrades performance by about 15%. Furthermore, encrypted databases usually cannot be compressed by most disk-compression software utilities because compression software usually relies on repeated patterns of data. The encryption process is so effective at removing any patterns that it renders most compression utilities ineffective. You need to decide whether this decrease in performance and the inability to compress the database file is worth the extra security that encryption provides.

    Part III: Creating Your Own Database and Objects
    Part V: Advanced Topics