Поделиться через


Rowsets (OLE DB)

This section explains how to create and release rowsets and how to set their properties, such as supported interfaces. Rowsets are the central objects that enable OLE DB components to expose and manipulate data in tabular form. A rowset object is a set of rows in which each row has columns of data. For example, providers present data, as well as metadata, to consumers in the form of rowsets. Query processors present query results in the form of rowsets. The use of rowsets throughout OLE DB makes it possible to aggregate components that consume or produce data through the same object.

Also explained in this section are ways to manage the activity of individual rows or rowsets: fetching, reference counting of row handles, and column access and reference. Rowset reference and fetching are discussed in the use of bookmarks, views, and chapters. The consumer uses bookmarks to return quickly to a row. Views can expose simple operations such as sorting or filtering a rowset. Chapters define groups of rows within a rowset. This section also discusses hierarchical rowsets, which are rowsets that are linked together by using chapters.

For more information on

Go to

Creating rowsets

Creating Rowsets

Column access

Deferred Columns and Column IDs

Rows

Rows and Row Handles

Fetching rows

Fetching Rows

Row status

DBROWSTATUS Enumerated Type

Bookmarks

Bookmarks (OLE DB)

Chapters

Chapters

Views

Views

Hierarchical rowsets

Hierarchical Rowsets

Navigation of hierarchical rowsets

Navigating Hierarchical Rowsets

Lifetime of row handles and chapters

Lifetime of Row Handles Within Chapters

The rowset object cotype is defined as follows. For more information about cotypes, see Conceptual Programming Models in OLE DB.

CoType TRowset {
   [mandatory]   interface IAccessor;
   [mandatory]   interface IColumnsInfo;
   [mandatory]   interface IConvertType;
   [mandatory]   interface IRowset;
   [mandatory]   interface IRowsetInfo;
   [optional]    interface IChapteredRowset;
   [optional]    interface IColumnsInfo2;
   [optional]    interface IColumnsRowset;
   [optional]    interface IConnectionPointContainer;
   [optional]    interface IDBAsynchStatus;
   [optional]    interface IGetRow;
   [optional]    interface IRowsetChange;
   [optional]    interface IRowsetChapterMember;
   [optional]    interface IRowsetCurrentIndex;
   [optional]    interface IRowsetFind;
   [optional]    interface IRowsetIdentity;
   [optional]    interface IRowsetIndex;
   [optional]    interface IRowsetLocate;
   [optional]    interface IRowsetRefresh;
   [optional]    interface IRowsetScroll;
   [optional]    interface IRowsetUpdate;
   [optional]    interface IRowsetView;
   [optional]    interface ISupportErrorInfo;
   [optional]    interface IRowsetBookmark;
}

All rowsets must expose the interfaces described in the following table.

Interface

Use

IRowset

Contains methods for fetching rows, getting row data, and maintaining reference counts on row handles.

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.

IRowsetInfo

Provides information about the rowset itself.

IConvertType

Provides information about the data type conversions supported by the rowset.

This section contains the following topics: