Chapter 24 Securing Your Database
Chapter 24 Securing Your Database
O
nce you have created your application, you will want some means of preventing
users from changing your application without going through your carefully
thought-out user interface.
You certainly do not want them making changes to your code. Thankfully, it is easy to
password-protect the code by clicking Tools |
window. Click the Protection tab in the pop-up window, check “Lock Project for Viewing,”
and enter and reenter your password. Save the project and your code is now protected.
However, as you have already seen, there are other components to your project—such as
tables, queries, forms, and reports—and it would be a disaster if a user decided to make a few
unauthorized changes! They can delete tables or edit a report, and since the database is
multiuser, this affects everyone using it.
You can stop this from happening in a number of ways.
Using an ACCDE File to Protect Your Application
You can save your application as an ACCDE file simply by clicking the File tab in the Access
ribbon, clicking Publish to Access Services in the central pane, clicking Save Database As in
the File Types pane, and then clicking the Make ACCDE icon in the Save Database As pane.
This will create a compiled file where the user cannot change forms, reports, or VBA
code. They can, however, still change tables and queries, and enter new data. This means that
your compiled application is still not as safe as you might wish.
Another problem is that you as the developer cannot make changes to forms, reports, or
VBA code either. Once you begin writing professional applications in Access, you will find
that the users always want to make changes after the application has been rolled out.
283