CCeDBDatabase::Open

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

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 );

At a Glance

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

Parameters

CeOID
The object identifier of the database.
szName
A null-terminated string containing the name of the database.
pKeyProp
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 member function. If the sort order is not important, set this parameter to zero.
pWndNotify
Handle 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 if the operation succeeded. FALSE if the database could not be opened. Call ::GetLastError to determine why the operation failed.

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 Overview, CCeDBDatabase Member Functions, Windows CE Database Classes, CCeDBDatabase::Close, ::GetLastError