CCeDBDatabase::SeekValueGreater

This member function searches for a record in the database for which the value of the specified property is greater than or equal to the value of the property passed in the Prop parameter. This function positions the read/write pointer at the record's location.

Syntax

CEOID SeekValueGreater( CCeDBProp& Prop );

At a Glance

Header file: Wcedb.h
Platforms:
Versions: 2.0 and later

Parameters

Prop
The property whose value is to be compared with the values of all properties in the database of the same type.

Return Values

The object identifier of a record having either the same value as Prop, or having the smallest value that is greater than the value of Prop, for the same type of property (as specified by the application-defined identifier of Prop). Zero if the seek operation fails; call ::GetLastError to determine why the operation failed.

Remarks

As an example, assume you have a database in which one of the properties has the enumerated constant AGE as its application-defined identifier. If you pass in a property whose identifier is AGE, and whose value is 39, this function will return the record whose AGE property is either equal to 39, or greater than 39, but less than any other AGE in the database that is also greater than 39. If multiple records satisfy the criteria (for instance, if there are two 40s in the database), this function will return whichever record comes first in the current sort order of the database.

A CCeDBDatabase object can only do a search on a property for which a sort order has been defined. This means that the database must have a sort property associated with it that has the same application-defined identifier as the property you pass in the Prop parameter. If the property for which you are seeking does not have a sort order defined for it, SeekValueGreater will fail, regardless of whether the record being sought actually exists in the database.

This function never sets the m_bEOF data member to TRUE.

See Also

CCeDBDatabase Overview, CCeDBDatabase Member Functions, Windows CE Database Classes, CCeDBDatabase::SeekValueSmaller, ::GetLastError