CeAddDatabaseProps (EDB) (Windows CE 5.0)
This function is used to add properties to an existing database.
This function does not work with CEDB databases. For more information about CEDB, see CEDB Reference.
BOOL CeAddDatabaseProps(PCEGUIDpGuid,CEOIDoidDb,DWORDcProps,CEPROPSPEC*prgProps);
Parameters
- pGuid
[in] The CEGUID of the mounted volume in which the database identified by the oidDb parameter resides. You can mount a volume by using the CeMountDbVolEx (EDB) function. - oidDb
[in] The OID of the database in which to add property IDs. This database must exist in the volume specified by the pGuid parameter. This OID must have been generated by the CeCreateDatabaseWithProps (EDB) function. - cProps
[in] The number of elements in the prgProps array. - prgProps
[in] An array of CEPROPSPEC (EDB) structures. This array specifies the set of properties to create in the new database. In EDB, you must define properties before you can write them by using the CeWriteRecordProps (EDB) function.
Return Values
TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError. The following table lists possible values returned by GetLastError:
Return Value | Description |
---|---|
ERROR_INVALID_PARAMETER | Indicates that one of the following conditions exists:
|
ERROR_NOT_FOUND | Indicates that the volume specified by pGuid does not exist, or the database specified by oidDb does not exist in the specified volume. |
ERROR_ALREADY_EXISTS | Indicates that an element of prgProps contains a property for which the propid or name already exists (a name is automatically generated if not given). |
ERROR_NOT_SUPPORTED | Indicates that an attempt has been made to add more than the maximum supported number of properties. EDB supports up to 1,024 properties. |
ERROR_SHARING_VIOLATION | Indicates that another thread currently has the database open. |
ERROR_ACCESS_DENIED | Occurs if you attempt to create a database with two primary key sort orders. |
Remarks
This function succeeds only if the database is not open.
You must define the properties of a database before you can write data using the CeWriteRecordProps function, unless the database is currently empty.
Properties can also be defined by calling the CeCreateDatabaseWithProps function. If you create any sort orders when calling CeCreateDatabaseWithProps, EDB internally creates all of the sort properties.
If one of the property IDs specified in the prgProps array already exists in the database, this function succeeds, and GetLastError returns ERROR_ALREADY_EXISTS. All of the other property IDs that do not exist will still be added.
To remove properties from a database, and potentially reduce the size of a volume, use the CeRemoveDatabaseProps (EDB) function.
Requirements
OS Versions: Windows CE 5.0 and later.
Header: Windbase.h.
Link Library: Coredll.lib.
See Also
CeMountDbVolEx (EDB) | CeWriteRecordProps (EDB) | CeCreateDatabaseWithProps (EDB) | CeRemoveDatabaseProps (EDB) | CEPROPSPEC (EDB) | EDB Schema Support
Send Feedback on this topic to the authors