|
AnyDAC
|
Specifies a locale ID for the local sorting operations.
Use the SortLocale property to specify a locale ID for the local sorting operations. The default value is LOCALE_USER_DEFAULT.
The local sorting is performed by the TADDataSet.IndexFieldNames and TADDataSet.Indexes properties. When the sorting is performed on a string column, the Windows API function
CompareString is used. The string comparison is performed using the SortLocale locale.
For TADMemTable, TADQuery and TADStoredProc the specifying of SortLocale is always optional. For TADTable it may be required, when the database collation differs from the default locale. Additionally the SortOptions may be used.
To specify a locale ID the MAKELCID, MAKELANGID and
DownlevelLocaleNameToLCID Windows API functions may be used. To enable binary string comparision specify 0.
property SortLocale: TADLocalID;
Setup TADTable to query the Firebird database with ISO8859_1 character set containing German language string data:
uses Windows; ... // Set locale ID to German phone book collation ADTable1.FormatOptions.SortLocale := MAKELCID(MAKELANGID (LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT); // Use the the punctuation and other symbols insensitive sorting ADTable1.FormatOptions.SortOptions := [soNoSymbols]; ADTable1.IndexFieldNames := 'NAME'; ADTable1.TableName := 'CUSTOMERS'; ADTable1.Open;
|
What do you think about this topic? Send feedback!
|