Basic ADO Programming Model

Microsoft ActiveX Data Objects (ADO)

Basic ADO Programming Model

ADO provides the means for you to perform the following sequence of actions:

  1. Connect to a data source. Optionally, you can ensure that all changes to the data source occur either successfully or not at all.

  2. Specify a command to gain access to the data source, optionally with variable parameters, or optionally optimized for performance.

  3. Execute the command.

  4. If the command causes data to be returned in the form of rows in a table, store the rows in a cache that you can easily examine, manipulate, or change.

  5. If appropriate, update the data source with changes from the cache of rows.

  6. Provide a general means to detect errors (usually as a result of making a connection or executing a command).

Typically, you will employ all these steps in the programming model. However, it is worth noting that ADO is flexible enough that you can do useful work by executing just part of the model. For example, you could store data from a file directly into a cache of rows, then use ADO resources solely to examine the data.

Next   ADO Programming Model in Detail.