Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This function is used to mount a volume. Although this function may be used to mount an EDB volume, applications should call CeMountDBVolEx (EDB) when mounting an EDB volume.
BOOLCeMountDBVol(PCEGUIDpceguid,LPWSTRlpszDBVol,DWORDdwFlags);
Parameters
- pceguid
[out] Pointer to a buffer that is filled in with the CEGUID value of the globally unique identifier of a mounted database. - lpszDBVol
[in] Pointer to the NULL-terminated string that contains the file name of the database volume to be mounted. The path is limited to MAX_PATH characters and includes the NULL character. - dwFlags
[in] Specification for opening the database volume. The following table shows the possible values for dwFlags.Value Description CREATE_NEW Creates a new database volume. The function fails if the specified database volume already exists. CREATE_ALWAYS Creates a new database volume. The function overwrites the database volume if it exists. OPEN_EXISTING Opens the database volume. The function fails if the database volume does not exist. OPEN_ALWAYS Opens the database volume if it exists. If the database volume does not exist, the function creates the database volume as if CREATE_NEW was specified. TRUNCATE_EXISTING Deletes all data on the volume, including databases and records, and resets the volume locale identifier (LCID). This has the same result as calling DeleteFile on a volume and then calling CeMountDBVol (EDB) with the CREATE_NEW flag set. The specified volume must not be mounted by an application, or an access denied error will occur. EDB_MOUNT_FLAG When set, indicates that an EDB database mount is occurring. When this flag is set, CeMountDbVol has the same effect as CeMountDBVolEx with a NULL pOptions parameter.
Return Values
TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError). The following table lists the possible values for GetLastError.
Value | Description |
---|---|
ERROR_DISK_FULL | Returned if the mounted volume does not have space to create the new database. |
ERROR_PATH_NOT_FOUND | Returned if the specified path was not found. |
ERROR_NOT_ENOUGH_MEMORY | Returned if there was not enough memory available to create the volume. If the database volume already exists before the function call and dwFlags is set to CREATE_ALWAYS or OPEN_ALWAYS, GetLastError returns ERROR_ALREADY_EXISTS, even through the function has succeeded. |
ERROR_ACCESS_DENIED | Returned if dwFlags is set to CREATE_ALWAYS or TRUNCATE_EXISTING. and a database volume with the given name is currently mounted by an application. This error is also returned if the file name refers to a file that is not a valid database volume. |
ERROR_ALREADY_EXISTS | Returned if dwFlags is set to CREATE_NEW and a database volume with the given name already exists. This error is also returned if a database volume is already mounted with the same CEGUID value as the new volume that is being mounted. |
Remarks
When you use the CeMountDBVol function to mount an EDB volume, this function calls the CeMountDbVolEx function, passing a value of NULL for the pOptions parameter.
Requirements
OS Versions: Windows CE 5.0 and later.
Header: Windbase.h.
Link Library: Coredll.lib.
See Also
CeMountDBVolEx (EDB) | CeMountDBVol
Send Feedback on this topic to the authors