MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 4: Rowsets


 

Chapter 4: Rowsets

This chapter 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 chapter 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 chapter also discusses hierarchical rowsets, which are rowsets that are linked together by using chapters.

For more information on Go to
Creating rowsets "Creating Rowsets" in this chapter
Column access "Deferred Columns" and "Column IDs" in this chapter
Rows "Rows" in this chapter
Fetching rows "Fetching Rows" in this chapter
Bookmarks "Bookmarks" in this chapter
Chapters "Chapters" in this chapter
Views "Views" in this chapter
Hierarchical rowsets "Hierarchical Rowsets" in this chapter
Navigation of hierarchical rowsets "Navigating Hierarchical Rowsets" in this chapter
Lifetime of row handles and chapters "Lifetime of Row Handles Within Chapters" in this chapter

The rowset object cotype is defined as follows. For more information about cotypes, see "OLE DB Objects" in Chapter 1, "Overview of 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 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;
}

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.