I am need to set the collation of one or all indices to "oem:de_DE" in ADS Server. This can be done manually through the Advantage Data Architect using Table Designer in the additional index definitions. But can I somehow set this property already in my code that reindexes my tables?
You can indeed use AX_SetCollation() to set a new collation for the next table open or table creation operation.
The function returns the previous setting.
The setting is stored in the X# runtime state and used by the ADS RDDs.
Please note that X# uses the same collation for all indexes by default.
With some hacking you could probably access and change the (internal) _Collation field in the ADS RDD object and change it between the creation of different indices.
If you add an enhancement request in our GitHub repo I can also try to add a way to change that using the DbInfo() function for a next build.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Thanks Robert, sounds promising. Do you know what are valid arguments for AX_SetCollation()? I tried using "oem" and "oem:de_DE", but couldn't see any effect in Advantage Data Architect.
This function specifies which collation language to use when opening tables, opening cursors, or creating tables. By default, no collation language is set and the client will use the language set by the Advantage Database Server.
Note Collation languages are only valid with ADT and VFP tables. For all other table types, the collation language is ignored.