The third and final week of this book covered several very important topics. This week's work was focused on database issues you'll encounter when you develop database applications for multiple users or multiple sites. You learned advanced SQL language for defining databases (DDL) and manipulating records within existing databases (DML). You also learned the five rules of data normalization and how applying those rules can improve the speed, accuracy, and integrity of your databases.
You learned about Visual Basic database locking schemes for the database, table, and page level. You also learned the advantages and limitations of adding cascading updates and deletes to your database relationship definitions. You learned how to use Visual Basic keywords BeginTrans, CommitTrans, and Rollback to improve database integrity and processing speed during mass updates.
You learned how to write data entry forms that use the ODBC API calls to link directly with the ODBC interface to access data in registered ODBC data sources. You also learned how to install the ODBC Administrator and how to create new ODBC data sources for your ODBC-enabled Visual Basic programs.
You learned how to create application-level security schemes such as user login and logout, program-level access rights, and audit trails to keep track of critical application operations.
Finally, you learned how to design and build online help systems for your Visual Basic applications, including the 10-point checklist for creating quality help systems. You also learned how to link help files directly to fields on a Visual Basic data form.
You started the week by learning how to create, alter, and delete database table structures using DDL (Data Definition Language) SQL keywords. You learned that using DDL statements to build tables, create indexes, and establish relationships is an excellent way to automatically document table layouts.
You learned how to maintain database structures using the following DDL keywords:
You continued your SQL studies on Day 16 with Data Manipulation Language (DML) keywords. These SQL keywords enable you to add, delete, and edit data within tables. You also learned how to use DML statements to quickly create test data for tables and load default values into startup tables. Plus, you learned that DML statements such as Append queries, Make Table queries, and Delete queries can outperform equivalent Visual Basic code versions of the same operations.
You learned how to manage data within the tables using the following DML keywords:
On Day 17, you learned how to improve database integrity and access speed using the five rules of data normalization. You learned the following five rules:
On Day 18, you learned about the following three important challenges that face every database programmer writing multiuser applications.
You also learned the following three levels of locking that are available to Visual Basic programs.
You learned how to use the Visdata application to create relation objects that enforce referential integrity and automatically perform cascading updates or deletes to related records. You learned that there are times when it is not advisable to establish cascading deletes (for example, do not use cascading deletes when the base table is a validation list and the foreign table is a master).
You also learned how to use database transactions to protect your database during extended, multitable operations. You learned how to use the BeginTrans, CommitTrans, and Rollback methods of the Workspace object. You also learned some of the advantages and limitations of transaction processing.
On Day 19, you learned how to use the Open Database Connectivity (ODBC) API set to directly link your Visual Basic program to target data sources via the ODBC interface. The ODBC interface is generally faster than Microsoft JET when it comes to linking to ODBC defined data sources.
You also learned how to install the ODBC interface on your workstation and how to use the ODBC Administrator program to install ODBC driver sets and define data sources for ODBC connections.
You learned how to build a program library that uses a minimum set of ODBC API calls along with several Visual Basic wrapper routines. This library set provides the basic functions needed to read and write data to and from a defined ODBC data source. You can use these routines to create fully functional data entry forms for ODBC data sources.
Finally, you used the library routines to build a data entry form that opens a link to a defined ODBC data source and allows the user the read and write data records for the ODBC data source.
Today's lesson covered several methods you can use to increase the level of security for your Visual Basic database applications. You learned the merits of using the Microsoft Access SYSTEM security file and the advantages and disadvantages of encrypting your database.
You also learned how to add application level security to your Visual Basic programs by adding user login/logout routines and creating a user access rights scheme for your applications. In this lesson, you designed and implemented a login screen you can use for all your Visual Basic applications, and you created several screens for maintaining user lists and managing access rights for each user.
You also learned how to add an audit trail option to your programs. You added routines to existing libraries that will log all critical user activity to an audit trail file, including user logins, database modifications, and all critical program operations, such as running reports or processing mass database updates.
On Day 21, you learned how to design and build online help files for your Visual Basic applications. You learned the 10 key points to developing good online systems:
10. Plan your help file in advance of writing it. Remember to write your online help first. Also, prepare your documentation as you develop your application rather than after the project is completely coded.