TMedDataset.DataCodePage TMedDataset

property DataCodePage: THbCodePage ;

Description

Use this property to set the character set in which table data is encoded. Set it to one of the following values:

·cdptDefault - the default setting. The actual data code page is determined at the moment of dataset activation by using TMedConnection.DataCodePage property value.

· any value from THbCodePage enumeration type.

Setting the right xHarbour character set allows proper character conversions to be applied when character data is fetched from or send to the database/table. The effective DataCodePage for the table and TMedConnection.AppCodePage determine the conversions applied.

When character data is written to the database the TMedConnection.AppCodePage -> TMedDataset.DataCodePage conversion is applied.

When character data is fetched from the database the TMedDataset.DataCodePage -> TMedConnection.AppCodePage conversion is applied.

If all your tables use same character encoding, the preffered way is to globally set code pages in TMedConnection.AppCodePage and TMedConnection.DataCodePage and leave MedDataset.DataCodePage property at its default value cdptDefault. This ensures that all tables/queries will be opened with the code page specified in TMedConnection.DataCodePage.