CeChangeDatabaseLCID (EDB) (Windows CE 5.0)

Send Feedback

This function changes the locale identifier (LCID) of a volume for sort operations.

VOID CeChangeDatabaseLCID(PCEGUIDpGuid,DWORDlcid);

Parameters

  • pGuid
    [in] The CEGUID of the mounted volume to which the LCID is applied.
  • lcid
    [in] The locale identifier to apply to the database volume.

Return Values

TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError. The following table lists possible values returned by GetLastError:

Return Value Description
ERROR_INVALID_PARAMETER Indicates that pGuid is NULL or that lcid is not valid.
ERROR_NOT_FOUND Indicates that the volume specified by pGuid does not exist.
ERROR_SHARING_VIOLATION Indicates that the LCID can only be changed if the volume is mounted once. This error may occur if there is an open handle on any database in the volume.

Remarks

This function rebuilds all sort orders on all databases in the volume. This can potentially be very time-consuming, which may not be desirable for the user.

When you create a database volume, the volume receives the default system LCID; that is, the database volume LCID is set to 0 and the LCID becomes the criteria by which string values for sorting can be compared. Data that exists in the database is sorted using this system LCID. Similarly, database actions that depend on sort order, such as adding a record, depend the LCID.

If you change the system LCID after creating a database volume, you must also use CeChangeDatabaseLCID to change the database LCID and re-sort the existing data. Otherwise, problems can occur when the database attempts to find or add new data based on the new LCID, but the existing data is sorted using the old system LCID.

If any database in the volume has an open handle, this function fails with ERROR_SHARING_VIOLATION.

There are no differences between this function and the CEDB equivalent function.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Windbase.h.
Link Library: Coredll.lib.

See Also

EDB Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.