MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 23: Rowsets in OLE DB for OLAP


 

Range Rowsets

In a range rowset, each row corresponds to a cell in the dataset. Each selected cell property appears as a column in this rowset. The range rowset can be created from the dataset by the IMDRangeRowset::GetRangeRowset method. The range rowset does not have to contain all the cells of the dataset. A subset of cells may be chosen in a manner similar to that used in IMDDataset::GetCellData. IMDRangeRowset is an optional interface on the dataset object. For information about how to determine whether or not the range rowset is supported by the provider, see "Data Source Property MDPROP_RANGEROWSET."

Consider the dataset in the SalesData example. The call

IMDRangeRowset::GetRangeRowset(NULL, 1, 19, cProperties, rgPropertySets, 
                               &pIRowsetChange);

returns the rowset shown in the following table, assuming that the default properties—VALUE, FORMATTED_VALUE, and CELL_ORDINAL—were selected.

Note   The quotation marks around values in the FORMATTED_VALUE column are there as a visual aid to indicate that they are strings. The provider does not return the quotes.

VALUE FORMATTED_VALUE CELL_ORDINAL
10 "10" 1
20 "20" 2
30 "30" 3
11 "11" 9
21 "21" 10
31 "31" 11
12 "12" 17
22 "22" 18
32 "32" 19

The primary uses of the range rowset are as follows:

The following rules govern the structure of the range rowset:

  1. The columns in the range rowset are ordered according to the following conditions:
  2. The CELL_ORDINAL column is always read-only.

  3. The other columns may or may not be read-only, based on provider-defined conditions. If the range rowset can be updated (that is, if it supports the IRowsetChange interface), usually at least one column, frequently the VALUE column, can be updated. Providers usually support the updating of other columns as well. To determine whether a column can be updated, consumers must check dwFlags in the DBCOLUMNSINFO structure for the column.

  4. The rows in the range rowset are ordered by CELL_ORDINAL column.