CCeDBDatabase::Create

This method creates a Windows CE database, but does not open it.

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

CEOID Create( LPCWSTR szName, DWORD dwIdent = 0, int nNumSortProps = 0, const CCeDBProp* pSortProps = NULL );

Parameters

szName
Null-terminated string that contains the name of the database. The maximum length of the name, including the terminating null character, is MAX_PATH.
dwIdent
Specifies the application-defined identifier of the database type.
nNumSortProps
Number of sort properties. This number cannot be greater than CEDB_MAXSORTORDER. Construct the sort properties using the following sort property constructor:

CCeDBProp::CCeDBProp(CCeDBProp::enType nType,WORD wIdent, WORD wSortFlags)

pSortProps
Pointer to an array of sort properties. The array must have the same number of properties as specified in nNumSortProps.

Return Values

The object identifier of the new database, or NULL if there is an error. To get extended error information, call GetLastError.

If the specified database already exists, it is not recreated, and the method returns FALSE.

Remarks

The pSortProps parameter cannot contain more than CEDB_MAXSORTORDER sort properties. In MFC for Windows CE 2.10, CEDB_MAXSORTORDER is defined as 4.

Two sort properties in the same database cannot have the same application-defined identifier.

The sort property passed in the pKeyProp parameter of the Open method must be one of the properties that was previously specified in a call to either Create or SetSortProps.

See Also

CCeDBDatabase::CCeDBDatabase, CCeDBDatabase::SetSortProps, CCeDBDatabase::Open, CCeDBProp::CCeDBProp, GetLastError