CCeDBDatabase::Create

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

Syntax

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

At a Glance

Header file: Wcedb.h
Platforms:
Versions: 2.0 and later

Parameters

szName
A null-terminated Unicode string containing the name of the database. The maximum length of the name, including the null-terminator, is MAX_PATH.
dwIdent
The application-defined identifier of the database type.
nNumSortProps
The number of sort properties. This number cannot be greater than CEDB_MAXSORTORDER. Construct the sort properties using the 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. Call ::GetLastError to determine why the operation failed.

Remarks

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

The pSortProps parameter cannot contain more than CEDB_MAXSORTORDER sort properties. In Windows CE 2.0, this number is four.

You cannot have two sort properties in the same database with the same application-defined identifier.

The sort property you pass in the pKeyProp parameter of the Open member function must be one of the properties you previously specified in a call to either Create or SetSortProps.

See Also

CCeDBDatabase Overview, CCeDBDatabase Member Functions, Windows CE Database Classes, CCeDBDatabase::CCeDBDatabase, CCeDBDatabase::SetSortProps, CCeDBDatabase::Open, CCeDBProp::CCeDBProp, ::GetLastError