You can prevent unauthorized users from opening a database by
assigning it a password. Then Access prompts anyone attempting to open
the database to enter the password, and will open it only if the
password is correct.
To assign a password to or remove a password from a database,
you must first open the database for exclusive use, meaning that no
one else can have the database open. This will not be a problem for a
database stored on your local computer and used only by you, but if
you want to set or remove a password for a database that is located on
a network, you will first need to make sure nobody else is using
it.
You can use any word or phrase as a database password, but to
create a secure password, keep the following in mind:
Passwords are case sensitive.
You can include letters, accented characters, numbers,
spaces, and most punctuation marks.
A good password includes uppercase letters, lowercase letters,
and symbols or numbers, and isn’t a word found in a dictionary.
Assigning a password to a database has an important secondary
benefit. A database created in Access is a binary file (a file that
stores instructions and data in such a way that it can usually be
understood only by a computer). If you open the file in a word
processor or a text editor, its content is mostly unreadable, but if
you look closely enough at the file, you can discover quite a bit of
information. It is unlikely that enough information will be exposed to
allow anyone to steal anything valuable. However, people can and do
scan files with computer tools designed to look for key words that
lead them to restricted information. When you assign a password to a
database, the database is automatically encrypted each time it is
closed, making it really unreadable. Opening the file in Access with
the correct password decrypts the file and makes its data readable
again.
A caveat: It is easy to assign a database password, and
certainly better than providing no protection at all, in that it keeps
most unauthorized people out of the database. However, many
inexpensive password recovery utilities are available, theoretically
to help people recover a lost password. Anyone can buy one of these
utilities and "recover" the password to your database. Also, because
the same password works for all users (and nothing prevents one person
from giving the password to many other people), simple password
protection is most appropriate for a single-user database.
In this exercise, you’ll assign a password to a database, test
it, and then remove it.
With Access running but no database open, display the
Backstage view, and in the left pane, click Open.
In the Open dialog box,
navigate to your practice file folder, and click (don’t
double-click) the GardenCompany12 database. Then click the
Open arrow, and in the list,
click Open Exclusive.
Access opens the database for your exclusive use. (In other
words, if the database were shared with other users, no one else
would be able to open it until you closed it.)
Display the Backstage view, and if the Info page is not
displayed, click Info in the
left pane.
From this page, you can run utilities to help prevent
database problems, assign a password, and assign file properties
that help identify the file.
The Info page of the Backstage
view.
Tip:
Tip
Clicking View And Edit Database Properties in the right
pane doesn’t display the Property Sheet. It displays the
GardenCompany12.accdb Properties dialog box, where you can
assign properties to the file, such as a title, subject, and
keywords, that help identify it and make it easier to find in
browsing dialog boxes and programs such as Windows
Explorer.
Click Encrypt with
Password.
The Set Database Password dialog box opens.
In this dialog box, Access will
disguise the characters of the password as asterisks as you type
them.
In the Password box, type 2010D@t@b@se!, and then press the Tab
key.
In the Verify box, type
2010D@t@b@se!. Then click
OK.
Access displays a message box warning that row-level locking
will be ignored.
Row-level locking is one of the
settings that prevent two people from making changes to the same
record (row) at the same time.
Tip:
Tip
If you have not enrolled in the Microsoft Customer
Experience Improvement Program, you will not see the Was This
Information Helpful link.
Click OK to close the
message box, and then close and reopen the database.
The Password Required dialog box opens.
You cannot work with the database
unless you know the password.
In the Enter database
password box, type 2010_D@tabase, and then click OK.
A message box opens.
Access warns that the password is not
valid.
In the message box, click OK.
When the Password
Required dialog box is redisplayed, type the correct
password, 2010D@t@b@se!, and
then click OK.
The database opens. Now let’s remove the password.
Display the Info page of
the Backstage view, and click Decrypt
Database.
Oops! The password cannot be removed unless the database is
open for exclusive use.
Close the database, and then open it for exclusive use,
entering the password when prompted.
On the Info page of the
Backstage view, click Decrypt
Database. Then in the Unset
Database Password dialog box, enter the password, and
click OK.
Access removes the password, allowing anyone to open the
database.