Accessing Data with ADO

   

ADO is the single data interface you need to know for all client/server and Web-based data access solutions. One of the strengths of ADO is that it can expose and use the unique properties of each data provider. No matter what data source is used, ADO is totally flexible and adaptable to your application's data access requirements.

ADO (like RDO) also includes a client batch cursor library that supports optimistic batch updates. With batch updates, you can create a result set, modify the data as required, and subsequently make all of the changes using the batch update method. This reduces server and network overhead and improves performance.

An important feature of using ADO is the availability of advanced recordset cache management with Remote Data Services (RDS). RDS provides optional data caching on the client workstation. With RDS, you can easily marshal data back and forth between the server and client. For example, your application may use a large client-side result set. This reduces the number of requests for data from the client-side application to the server, improving both the actual performance and the perceived performance of the client-side application. Furthermore, you can open and populate a disconnected Recordset object asynchronously. This improves performance by leaving the client free to execute other tasks while records are still being returned.

A typical ADO-based application uses the following operations to access a data source.

  • Create the Connection object   Specifies the connection string with information such as data source name, user identification, password, connection time-out, default database, and cursor location. A Connection object represents a unique session with a data source. You can even control transactions through the Connection object using the BeginTrans, CommitTrans, and RollbackTrans methods.
  • Open the connection   Opens the ADO connection to the data source.
  • Execute an SQL statement   Once the connection is open, you can run a query. You can run this query asynchronously and also choose to process the query's result set asynchronously; ADO signals the cursor driver to populate the result set in the background. This lets your application perform other processes without waiting.
  • **Use the result set   **The result set is now available to your application. Depending on the cursor type, you can browse and change the row data at either the server or client side.
  • Terminate the connection   Drops the connection to the data source.

Although ADO objects have many properties and methods, using ADO is really as simple as it looks. ADO definitely represents the future of data access technology.