Chapter 7. Database System Architecture

Why Program?

There is no doubt that SQL is a powerful language—as far as it goes. However, it is a somewhat unfriendly language, and it lacks the sophisticated control structures of a more traditional language, such as For...Next... loops and If...Then... statements.

This is not really a problem, since SQL is designed for a very specific purpose related to database-component creation and manipulation. SQL is not designed to provide an overall programming environment for Microsoft Access itself. This role is played by Visual Basic for Applications (VBA).

VBA is the macro or scripting language for all of the major Microsoft Office products: Microsoft Access, Excel, PowerPoint, and Word (starting with Word 97). It is a very powerful programming language that gives the programmer access to the full features of these applications, as well as the means to make the applications work together.

One of the major components of VBA is its support for Data Access Objects model, (DAO). DAO is the programming-language interface for the Jet database management system (DBMS) that underlies Microsoft Access. It provides a more-or-less object-oriented data definition language (DDL) and data manipulation language (DML), thereby allowing the VBA programmer to define the structure of a database and manipulate its data.

Of course, it is natural to wonder why you would want to use DAO, and VBA in general, rather than using the built-in graphical interface of Microsoft ...

Get Access Database Design & Programming, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.