CCeDBDatabase::SetSortProps

This method sets the new sort order of the database.

At a Glance

Header file: Wcedb.h
Platforms: H/PC 2.0, Palm-size PC, H/PC Pro
Windows CE versions: 2.0 and later

Syntax

BOOL SetSortProps( int nSize, const CCeDBProp *pSortProps );

Parameters

nSize
Number of sort properties in pSortProps. This number cannot be greater than CEDB_MAXSORTORDER.
pSortProps
Pointer to an array of sort properties to assign to the database. There should be nSize sort properties in the array. Construct the sort properties using the following sort property constructor:

CCeDBProp::CCeDBProp(CCeDBProp::enType nType,WORD wIdent, WORD wSortFlags)

Return Values

TRUE indicates that the last modified date and time were successfully set. FALSE indicates that there was an error. To get extended error information, call GetLastError.

Remarks

The pSortProps parameter cannot contain more than CEDB_MAXSORTORDER sort properties. In MFC for Windows CE 2.10, CEDB_MAXSORTORDER is defined as 4.

You cannot have two sort properties in the same database with the same application-defined identifier.

The sort property you pass in the pKeyProp parameter of the Open method must be one of the properties you previously specified in a call to either SetSortProps or Create.

See Also

CCeDBDatabase::Create, CCeDBDatabase::GetSortProps, CCeDBDatabase::Open, CCeDBProp::CCeDBProp, GetLastError