Partager via


CeOpenDatabaseEx (CEDB) (Compact 2013)

3/26/2014

This function opens an existing database on any mounted database volumes. This function is obsolete. Call the CeOpenDatabaseEx2 (CEDB) funcition instead.

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 pceguidto 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 Compact databases are committed after each individual call, not when opening and closing a database.

Requirements

Header

windbase.h

Library

coredll.lib

See Also

Reference

CEDB Functions
CeCreateDatabaseEx (CEDB)
CeReadRecordPropsEx (CEDB)
CeSeekDatabase (CEDB)
CloseHandle
CREATE_INVALIDGUID
CENOTIFICATION[CEDB]
CeOpenDatabaseEx2 (CEDB)