OLE DB Programmer's Reference |
Specifies a sort order to be applied to a view.
HRESULT SetSortOrder ( DBORDINAL cColumns, const DBORDINAL rgColumns[], const DBSORT rgOrders[]);
Parameters
The DBSORT structure is as follows:
typedef DWORD DBSORT; enum DBSORTENUM { DBSORT_ASCENDING = 0, DBSORT_DESCENDING };
Return Code
rgOrders was NULL, and cColumns was not equal to zero.
The same column ordinal appeared multiple times in rgColumns.
Comments
A provider may impose constraints on the columns that can be used for sorting. For example, a provider may support ordering only on columns for which there exists an index. If the provider does not support sorting for the specified columns, it returns DB_E_CANTORDER. If there is already a sort order applied to a view, IViewSort::SetSortOrder overrides the previous sort order.
The setting of sort columns is atomic. If any columns cannot be set, IViewSort::SetSortOrder returns DB_E_CANTORDER and the sort order for the view remains unchanged.
Changing the sort order of a view does not change the sort order of any rowsets or chapters previously opened using that view.
1998-2001 Microsoft Corporation. All rights reserved.