CeOpenDatabaseEx (CEDB) (Windows CE 5.0)
This function opens an existing database on any mounted database volumes. This function is obsolete. Applications should call CeOpenDatabaseEx2 instead.
This function does not work with EDB databases. For more information on EDB, see EDB Functions.
A RAPI version of this function exists called CeOpenDatabaseEx (RAPI).
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 identifier of a mounted database volume, or of the object store. Use CREATE_SYSTEMGUID to obtain the GUID of the object store. If pceguid points to a CEGUID created with the CREATE_INVALIDGUID macro, then poid 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 poid to 0, 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, lpszName is ignored. - propid
[in] Property identifier of the sort key for the database. All subsequent calls to CeSeekDatabase (CEDB) assume this sort order. This parameter can be 0 if the sort order is not important. In that case, a sort order will be chosen for you. - dwFlags
[in] Bitmask of action flags. The following table shows the possible values for this parameter.Value Description CEDB_AUTOINCREMENT Causes the current seek position to be automatically incremented with each call to CeReadRecordPropsEx (CEDB). 0 Prevents the current seek position from being incremented with each call to CeReadRecordPropsEx. The seek position will only be changed by calls to CeSeekDatabaseEx (CEDB). - pReq
[in] Pointer to a CENOTIFYREQUEST structure that requests notifications be sent to an identified window. This parameter can be NULL if an application does not need to receive notifications.
Return Values
A handle to the open database indicates success. INVALID_HANDLE_VALUE indicates failure. To get extended error information, call GetLastError. The following table lists possible values for GetLastError.
Value | Description |
---|---|
ERROR_INVALID_PARAMETER | Indicates that a parameter was invalid. |
ERROR_FILE_NOT_FOUND | Indicates that no database exists with the specified name. This error code applies only if the value pointed to by poid was set to NULL, when the function was called. |
ERROR_NOT_ENOUGH_MEMORY | Indicates that no memory was available to allocate the database handle. |
Remarks
An application must use the CloseHandle function to close the handle returned by the CeOpenDatabaseEx function.
Changes to Windows CE databases are committed after each individual call, not when opening and closing a database.
Requirements
OS Versions: Windows CE 2.10 and later.
Header: Windbase.h.
Link Library: Coredll.lib.
See Also
CeCreateDatabaseEx (CEDB) | CeReadRecordPropsEx (CEDB) | CeSeekDatabase (CEDB) | CloseHandle | CREATE_INVALIDGUID | CENOTIFICATION | CeOpenDatabaseEx2 (CEDB)
Send Feedback on this topic to the authors