Chapter 2: Getting Data

Microsoft ActiveX Data Objects (ADO)

ADO 2.5

Chapter 2: Getting Data

The preceding chapter introduced four primary operations involved in creating an ADO application: getting data, examining data, editing data, and updating data. This chapter will focus on the details of the concepts relevant to the first operation: getting data.

Several ADO objects can play a role in this operation. First you connect to the data source using an ADO Connection object (which at times will be created implicitly). Then you pass instructions to the data source about what you want to do using an ADO Command object (which also can be created implicitly). The result of passing a command to a data source and receiving its response usually will be represented in an ADO Recordset object.

To get data, your application must be in communication with a data source, such as a DBMS, a file store, or a comma-delimited text file. This communication represents a connection—the environment necessary for exchanging data.

The ADO object model represents the concept of a connection with the Connection object—the foundation upon which much ADO functionality is built. The purpose of a Connection object is to:

  • Define the information ADO needs to communicate with data sources and create sessions.
  • Define the transactional capabilities of the session.
  • Allow you to create and execute commands against the data source.
  • Provide information about the design of the underlying data source in the form of schema rowsets. For more information about schema rowsets, see OpenSchema Method.

© 1998-2003 Microsoft Corporation. All rights reserved.