Share via


DBPROP_ACCESSORDER

Property group: Rowset

Property set: DBPROPSET_ROWSET

Column? N

Type: VT_I4

Typical R/W: R/W

Description: Access Order

Sets the order in which columns must be accessed by methods (such as IRowset::GetData, IRow::GetColumns, and IRow::Open) that operate on rowsets, rows, and streams.

Note

For optimal performance and interoperability, consumers should set this property to DBPROPVAL_AO_SEQUENTIALSTORAGEOBJECTS.

Value

Meaning

DBPROPVAL_AO_RANDOM

Columns can be accessed in any order.

DBPROPVAL_AO_SEQUENTIALSTORAGEOBJECTS

Columns bound as storage objects can be accessed only in sequential order as determined by the column ordinal. Further, storage objects from one row must be retrieved before calling IRowset::GetData on any columns in any subsequent row. Calling IRowset::GetData on a column bound as a storage object returns DBSTATUS_E_UNAVAILABLE for any columns bound as storage objects if any of the following are true:

  • Columns beyond the column bound as a storage object are specified in the accessor.

  • Columns beyond the column bound as a storage object have been accessed in a previous call to IRowset::GetData for that row.

  • IRowset::GetData has been called for any columns on a row returned after the specified row.

Providers that never impose restrictions on column access ordering return DBPROPSTATUS_S_OK when this value is set. However, they upgrade the property to DBPROPVAL_AO_RANDOM such that calling IRowsetInfo::GetProperties continues to return DBPROPVAL_AO_RANDOM for this property.

DBPROPVAL_AO_SEQUENTIAL

All columns must be accessed in sequential order determined by the column ordinal. Further, all columns from one row must be retrieved before calling IRowset::GetData on any columns in any subsequent row. Calling IRowset::GetData returns DBSTATUS_E_UNAVAILABLE for any columns for which any of the following are true:

  • The column is bound as a storage object, and columns beyond it are specified in the accessor.

  • Columns beyond the bound column have been accessed in a previous call to IRowset::GetData for that row.

  • IRowset::GetData has been called for any columns on a row returned after the specified row.

Providers that never impose restrictions on column access ordering return DBPROPSTATUS_S_OK when this value is set. However, they upgrade the property to DBPROPVAL_AO_RANDOM such that calling IRowsetInfo::GetProperties continues to return DBPROPVAL_AO_RANDOM for this property.

Providers may be able to optimize how data is retrieved if they know it will be read in column order. For instance, the provider may be able to read directly from a stream over the data if it knows the columns will be read in strictly sequential order, but may not be able to do so efficiently if the columns contain BLOBs that may be read in a random order.

See Also

Reference

Properties (Alphabetical)