CeWriteRecordProps (CEDB) (Compact 2013)


This function writes a set of properties to a single record, creating the record if necessary.


CEOID CeWriteRecordProps(
  HANDLE hDbase, 
  CEOID oidRecord, 
  WORD cPropID, 
  CEPROPVAL* rgPropVal


  • hDbase
    [in] Handle to an open database. The database must have been opened by a previous call to the CeOpenDatabase (CEDB) function.
  • oidRecord
    [in] Object identifier of the record to which the specified properties are to be written. If this parameter is set to zero, a new record is created and filled in with the specified properties.
  • cPropID
    [in] Number of properties in the array specified by the rgPropVal parameter. The cPropID parameter must not be set to zero.
  • rgPropVal
    [in] Pointer to an array of CEPROPVAL [CEDB] structures that specify the property values to be written to the specified record.

Return Value

The object identifier of the record to which the properties were written indicates success. Zero indicates failure. To get extended error information, call GetLastError. The following table shows possible return values.




Indicates that theres was not enough space in the object store to write the properties.


Indicates that a parameter was invalid.


This function writes all the requested properties into the specified record. This function leaves the seek pointer on the record that is written to. However, the position of that record in the sort order can change if its sort properties are modified. Therefore, using this function in conjunction with the CeSeekDatabaseEx (CEDB) function may result in unexpected seek behavior.

To delete a property, set the CEDB_PROPDELETE flag in the appropriate property value. This allows multiple deletes and changes in a single call, which is much more efficient than multiple calls.

No memory is freed by the caller. Pointers in the CEPROPVAL structures can be anywhere in the caller's address space. They can be marshaled, as in the array returned by the CeReadRecordProps (CEDB) function, or they can be independently allocated.

On a mounted database volume, all write operations are cached. The database subsystem periodically requests a cache flush after a series of operations. If memory is low, the cache is flushed to permanent storage. Unlike a file system that can choose to flush only part of the cache, on a database, all blocks are flushed.

If this function is called by a replication synchronization client thread, the synchronization flags determine its behavior. If the client has set the REPL_SYNC_ALLOWOVERWRITE flag, the call proceeds normally. If the REPL_SYNC_ALLOWOVERWRITE flag is not set, the call can fail with ERROR_ACCESS_DENIED, to block the synchronization client from overwriting changes it has not yet read. For more information, see ReplOpenSync and ReplChangeSyncSettings.






See Also


CEDB Functions
CeOpenDatabaseEx2 (CEDB)
CeReadRecordPropsEx (CEDB)