CeOpenDatabaseEx (CEDB)
Other versions of this page are also available for the following:
8/28/2008
This function opens an existing database on any mounted database volumes. This function is obsolete. Call the CeOpenDatabaseEx2 (CEDB) funcition instead.
A RAPI version of this function exists called CeOpenDatabaseEx (RAPI).
Syntax
HANDLE CeOpenDatabaseEx(
PCEGUID pceguid,
PCEOID poid,
LPWSTR lpszName,
CEPROPID propid,
DWORD dwFlags,
CENOTIFYREQUEST* pReq
);
Parameters
- pceguid
[in] Pointer to the CEGUID that contains the globally unique identifierof a mounted database volume or of the object store. Use the CREATE_SYSTEMGUID macro to obtain the GUID of the object store. If this parameter points to a CEGUID created with the CREATE_INVALIDGUID macro, the poid parameter is ignored and the object store and all mounted database volumes are searched for a database whose name matches lpszName. The search is completed when the first match is located.
- poid
[in] Pointer to the object identifier of the database to be opened. To open a database by name, set the value pointed to by this parameter to zero, set lpszName to the database name, and set pceguid ** to the database volume.
- lpszName
[in] Long pointer to the null-terminated string that contains the name of the database to be opened. This is used along with pceguid to specify the database if the value pointed to by poid is zero. If the value pointed to by poid is nonzero, this parameter is ignored.
- propid
[in] Property identifier of the sort key for the database. All subsequent calls to the CeSeekDatabase (CEDB) function assume this sort order. This parameter can be set to zero if the sort order is not important. In that case, a sort order is chosen for you.
dwFlags
[in] Bitmask of action flags. The following table shows possible values.Value Description CEDB_AUTOINCREMENT
Increments the current seek position with each call to the CeReadRecordPropsEx (CEDB) function.
Zero
Prevents the current seek position from being incremented with each call to CeReadRecordPropsEx. The seek position is changed only by calls to the CeSeekDatabaseEx (CEDB) function.
- pReq
[in] Pointer to a CENOTIFYREQUEST (CEDB) structure that requests notifications be sent to an identified window. This parameter can be set to NULL if an application does not need to receive notifications.
Return Value
A handle to the open database indicates success. INVALID_HANDLE_VALUE indicates failure. To get extended error information, call GetLastError. The following table shows possible values.
Value | Description |
---|---|
ERROR_FILE_NOT_FOUND |
Indicates that no database exists with the specified name. This error code applies only if the value pointed to by the poid parameter was set to NULL when the function was called. |
ERROR_INVALID_PARAMETER |
Indicates that a parameter was invalid. |
ERROR_NOT_ENOUGH_MEMORY |
Indicates that there was not enough available memory to allocate the database handle. |
Remarks
An application must use the CloseHandle function to close the handle returned by this function.
Changes to Windows Embedded CE databases are committed after each individual call, not when opening and closing a database.
Requirements
Header | windbase.h |
Library | coredll.lib |
Windows Embedded CE | Windows CE 2.10 and later |
See Also
Reference
CEDB Functions
CeCreateDatabaseEx (CEDB)
CeReadRecordPropsEx (CEDB)
CeSeekDatabase (CEDB)
CloseHandle
CREATE_INVALIDGUID
CENOTIFICATION (CEDB)
CeOpenDatabaseEx2 (CEDB)