CCeDBDatabase::WriteCurrRecord

This member function writes properties to the current record.

Syntax

BOOL WriteCurrRecord( CCeDBRecord* pRecord, int nNumFilterProps = 0, CCeDBProp *PropFilterArray = NULL );

At a Glance

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

Parameters

pRecord
A pointer to a record that contains the data you want to write to the current record in the database.
nNumFilterProps
The number of properties in PropFilterArray. If this parameter is set to zero, the entire contents of pRecord will be written to the current record in the database.
PropFilterArray
An array of valueless properties whose application-defined identifiers specify which properties to copy from pRecord into the current database record. Construct the valueless properties by using the sort property constructor CCeDBProp::CCeDBProp(CCeDBProp::enType nType,WORD wIdent, WORD wSortFlags). (Sort flags are ignored.) If you pass in a null pointer, the entire record will be written to the database.

Return Values

TRUE if the record was successfully written. FALSE if there was an error. Call ::GetLastError to determine why the operation failed.

Remarks

The CCeDBRecord object you pass by reference in the pRecord parameter does not have to contain all the properties that the current record in the database does. You can pass in a record that contains only the specific properties you want to change. In this case, you do not need to use a filter array. For example, if the record in the database has eight properties, and you only need to modify two of them, you can create a new record with just those two properties, and pass a pointer to that record in pRecord. You would not use the other two parameters.

On the other hand, if you already have the current record open from a previous ReadCurrRecord operation, you can make changes directly to the properties in that CCeDBRecord object. Then, create a filter array of valueless properties with the same application-defined identifiers as the properties you want to change in the record. Then pass a pointer to the record in the pRecord parameter, the number of properties you modified in the nNumFilterProps parameter, and the filter array in the PropFilterArray parameter.

Whenever you alter a record, the records are resorted so they'll be in the proper order for next seek operation.

See Also

CCeDBDatabase Overview, CCeDBDatabase Member Functions, Windows CE Database Classes, CCeDBDatabase::ReadCurrRecord, CCeDBDatabase::SeekNext, CCeDBProp::CCeDBProp, ::GetLastError