Team LiB
Previous Section Next Section

Chapter 4: Jet SQL, the ADOX Library, and Queries

Overview

Tables are the basic building blocks of databases, but queries are where much of the literal and figurative action occurs. Developers use queries to extract information from tables. These queries often serve as the record sources for forms, reports, and Web pages. Therefore, database users typically view database tables filtered through queries.

In addition to this support for forms, reports, and Web pages, queries and languages for expressing them (ADOX and Jet SQL) support three literal kinds of action. First, you can use parameter queries to enable run-time user interaction with an application. Second, you can use queries to insert, delete, and update the records in a record source. Third, you can use Jet SQL, the language for expressing queries for the Jet database engine, to create tables and other database objects. Using Jet SQL to create database objects is an alternative to performing data definition tasks with the ADOX library.

This chapter contains four major sections. The first section examines the most common Jet SQL formulations for returning records from tables. Learning Jet SQL liberates you from depending on the Microsoft Access Query Designer to develop queries, thus allowing you to create solutions faster. Mastering Jet SQL will help you expand the roles that recordsets play in your applications and allow you to secure your applications by not putting all your objects in the Database window.

The second section, "Managing Row-Returning Queries with ADOX," shows you how to create new queries programmatically by adding members to the Views and Procedures collections. This section also demonstrates how to add or modify database queries with your workstation temporarily disconnected from the database.

"Creating and Running Action Queries with ADOX" takes a close look at the design and use of parameter queries. This final section of the chapter pays special attention to using parameters for inserting, deleting, and updating records from a record source. It also discusses the use of Jet SQL for table definition tasks. By learning how to perform data definition with Jet SQL, you can take advantage of features not supported by the ADOX library or Access user interface, such as controlling the step size and seed value for AutoNumber columns.


Team LiB
Previous Section Next Section