CCeDBDatabase::SeekValueSmaller

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

Syntax

CEOID SeekValueSmaller( 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 the record having the largest value that is smaller 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 NAME as its application-defined identifier. If you pass in a property whose identifier is NAME, and whose value is "Jones", this function will return the record for which the string value of the NAME property evaluates to less than Jones, but to greater than any other name in the database whose string value is also less than "Jones". If multiple records satisfy the criteria (for instance, if there are two "Jacksons" 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, SeekValueSmaller 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::SeekValueGreater, ::GetLastError