OLE DB Programmer's Reference

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 calling IMDRangeRowset::GetRangeRowset. 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:
    • If the MDX statement that created the dataset had a CELL PROPERTIES clause, the columns appear in the order specified in that clause. Otherwise, the columns are VALUE, FORMATTED_VALUE, and CELL_PROPERTIES, in that order. In the case where the MDX statement has a property specified multiple times in the CELL PROPERTIES clause (for example, CELL PROPERTIES CELL_ORDINAL, VALUE, FORMATTED_VALUE, and VALUE), the results are provider-specific.
    • What happens in either of the following cases is provider-specific: Either the MDX statement has CELL_ORDINAL specified in the CELL PROPERTIES clause, but not as the first property (for example, CELL PROPERTIES VALUE, CELL_ORDINAL), or the MDX statement has a property specified multiple times in the CELL PROPERTIES clause (for example, CELL PROPERTIES CELL_ORDINAL, VALUE, FORMATTED_VALUE, VALUE).
  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.