Chapter 4: Providing a Solid Foundation with Good Programming Practices


Overview

When I thought about the demonstration material that I was providing with this book, three mechanisms stood out as being both relevant to your protection strategy and good database design in general:

  • Using the AutoExec macro as a springboard for your application.

  • Separating your tables and the relationships model into one database and placing all the remaining programming objects into a second database (called database splitting).

  • Savvy and proactively using VBA code for Applications (VBA) error handling.

While reviewing the Access help files, other Access books, and even the Internet, I was surprised at the lack of prominence given to the first two of these programming topics. I feel they are fundamental because probably 90 percent of the databases that I've dealt with have used the database splitting technique, and most databases have an AutoExec macro. Therefore, in this chapter, I propose to redress that anomaly by featuring these two important topics.

VBA code error handling has been well covered in many publications . However, I shall underscore some of the common wisdom ”adding my own perspective ” and discuss error handling and its relevance to database protection. I'll even provide some useful tricks to improve your debugging efforts.

The demonstration material for this chapter includes a sample AutoExec macro and a module that will allow you to add your own relinking code to your split database. For Access 2002 users, I've included a demonstration of how to use the new FileDialog object to locate files. For errors and error handling, there are samples of standard, good, and nonexistent error handling. There are also samples of ignoring errors and trapping errors in lower-level procedures.

Note  

To find the demonstration material, open the download database for your version of Access (for example, grMAP2002.mdb ) and select Chapter 4.




Real World Microsoft Access Database Protection and Security
Real World Microsoft Access Database Protection and Security
ISBN: 1590591267
EAN: 2147483647
Year: 2003
Pages: 176

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net