MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 1: Overview of OLE DB


 

Rowset Objects

A rowset is the central object that enables all OLE DB data providers to expose data in tabular form. Conceptually, a rowset is a set of rows in which each row has columns of data. Data providers present their data in the form of rowsets. Service components (such as query processors) also present data (such as the result of queries) in the form of rowsets. This makes it possible to efficiently aggregate components that consume or produce data through the same object.

The most basic rowset object exposes the interfaces described in the following table.

Interface Purpose
IAccessor Permits the definition of groups of column bindings describing the way tabular data is bound to consumer program variables.
IColumnsInfo Provides information about the columns of the rowset.
IConvertType Provides information about the availability of type conversions on the rowset.
IRowset Contains methods for fetching rows in the rowset sequentially.
IRowsetInfo Provides information about the rowset itself.

By using IRowset, a consumer can traverse the rows in the rowset, including traversing backward if the rowset supports it. The following illustration shows the data structures a generic rowset object might support.

Data structures supported by a generic rowset object

Other rowset interfaces expose additional rowset capabilities. For example, there is an interface to insert, delete, and update rows and interfaces that expose richer row navigation models, such as direct access and approximate positioning.

Rowsets can be created over base data in one of two ways. First, they can be created as the result of a query. Second, they can be created directly as the result of calling IOpenRowset::OpenRowset. All providers support creation by calling IOpenRowset::OpenRowset. However, simple providers—such as those built over a base table, index, file, or in-memory structure rather than a relational DBMS—usually do not support creation by query.