CCeDBDatabase::WriteCurrRecord

This method writes properties to the current record.

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 WriteCurrRecord( CCeDBRecord* pRecord, int nNumFilterProps = 0,
CCeDBProp *
PropFilterArray = NULL );

Parameters

pRecord
Pointer to a record that contains the data to write to the current record in the database.
nNumFilterProps
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
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 indicates that the record was successfully written. FALSE indicates that there was an error. To get extended error information, call GetLastError.

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 are in the proper order for next seek operation.

See Also

CCeDBDatabase::ReadCurrRecord, CCeDBDatabase::SeekNext, CCeDBProp::CCeDBProp, GetLastError