Chapter Summary

This chapter demonstrated several methods of the ADO Recordset object you can use for working with records. You learned about the Add, Update, and Delete methods for performing such common database tasks as adding, modifying, and deleting records. These methods are suitable for handling a small number of records. Better performance can be achieved by using the SQL INSERT, UPDATE, and DELETE statements, as shown in Chapter 23.

This chapter also showed you how to render your database records into three popular formats: an Excel spreadsheet, a Word document, and a text file. Because working with large quantities of records can be difficult unless data is properly organized, this chapter also covered methods for filtering and sorting your records.

In the next chapter you will learn how to use ADO to create and run Access queries.

Chapter 15

Creating and Running Queries with ADO

Having worked with Microsoft Access for a while, you already know that to retrieve relevant information from your database and perform data-oriented tasks you need to write queries. Queries are SQL statements that are saved in the database and can be run at any time. Microsoft Office Access 2003 supports several types of queries.

The simplest queries allow you to select a set of records from a table. However, when you need to extract information from more than one table at a time, you must write a more complex query by using an SQL JOIN statement. Other queries perform specific actions on existing data, such as making a new table, appending rows to a table, updating the values in a table, or deleting rows from a table. Although Microsoft Office Access 2003 provides a friendly interface — the Query Design view — for creating queries manually, this chapter teaches you how to create and execute the same queries by using ActiveX Data Objects (ADO) and Data Manipulation Language (DML) SQL statements in VBA code.

0 0

Post a comment