Freigeben über


CeAddDatabaseProps (EDB) (Windows CE 5.0)

Send Feedback

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:
  • pGuid is NULL.
  • oidDb is NULL.
  • cProps is 0.
  • prgProps is NULL.
  • Any of the elements in prgProps are not valid. The following members of the CEPROPSPEC structure must be valid:
    • wVersion must be set to CEPROPSPEC _VERSION.
    • propid must be a valid CEVT_xxx data type.
    • The dwFlags member for a property can only include DB_PROP_COMPRESSED if the property is a CEVT_STREAM.
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

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.