Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function obtains some or all properties of a database.

Syntax

BOOL CeGetDatabaseProps (
  HANDLE 
hDatabase,
  LPWORD 
lpcPropID,
  CEPROPID* 
prgPropID,
  CEPROPSPEC* 
prgProps
);

Parameters

hDatabase

[in] Handle to an open database. This handle is obtained by calling the CeOpenDatabaseInSession (EDB)function.

lpcPropID

[in, out] Number of property IDs in the prgPropID array.

prgPropID

[in] Pointer to an array of property IDs that specifies the properties to be retrieved. If this parameter is set to NULL the first *lpcPropIDproperties are returned. This enables properties to be returned without knowing the property IDs.

prgProps

[in, out] Array of CEPROPSPEC (EDB)in which the property information is to be placed. If the value of this parameter is set to NULL, the number of properties in the database is returned in *lpcPropID. The caller must set the wVersionvalue of the elements of prgPropsto CEPROPSPEC_VERSION before calling this function.

The pwszPropNamefield of CEPROPSPECmust be set to point to an empty string buffer to pre-allocate space for property names.

Return Value

TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError. The following table shows possible values.

Return Value Description

ERROR_INSUFFICIENT_BUFFER

There is not enough memory available for one of the property names.

ERROR_INVALID_HANDLE

The hDatabase parameter is set to NULL or equal to INVALID_HANDLE_VALUE.

ERROR_INVALID_PARAMETER

Indicates one of the following:

  • The lpcPropIDparameter is set to NULL.

  • Any of the elements in prgPropsdoes not have wVersionequal to CEPROPSPEC _VERSION.

Remarks

This function can be used to perform any of the following operations:

  • Find the number of properties in a database. Set prgPropsto NULL.

  • Select only a subset of properties. Set required property IDs in prgPropID.

  • Return properties, even if their property IDs are not known. Set prgPropIDto NULL.

If any of the properties specified in prgPropIDdoes not exist in the database, the corresponding positions in prgPropssets the wVersionvalue to zero.

Properties are added to a database by using the CeAddDatabaseProps (EDB)function and removed by using the CeRemoveDatabaseProps (EDB)function.

Requirements

Header windbase.h
Library coredll.lib
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also