CCeDBDatabase::Open

This method opens the database and, optionally, specifies which sort order to use.

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

BOOL Open( CEOID CeOID, const CCeDBProp* pKeyProp = NULL,
const
CWnd* pWndNotify = NULL );

BOOL Open( LPCWSTR szName, const CCeDBProp* pKeyProp = NULL,
const CWnd*
pWndNotify = NULL );

Parameters

CeOID
Object identifier of the database.
szName
Null-terminated string that contains the name of the database.
pKeyProp
Pointer to a sort property that represents the primary key for the sort order in which to search the database or list its records. The sort property must be one of the sort properties established for this database in either the Create or SetSortProps method. If the sort order is not important, set this parameter to zero.
pWndNotify
Pointer to the window that should receive notification messages if another thread modifies the database while your application has it open. If your application does not need to receive notifications, set this parameter to NULL.

Return Values

TRUE indicates that the operation succeeded. FALSE indicates that the database could not be opened. To get extended error information, call GetLastError.

Remarks

All seek operations performed on the database will use the sort order specified in pKeyProp. If you want to select a different sort order, you must reopen the database. If no sort order is specified, the order in which the records are sorted is undefined.

See Also

CCeDBDatabase::Close, GetLastError