Reputation: 23
I got an accounting software that use dBase III database directly. I also got an home made software written in Delphi XE2 that use these database. Delphi use Sybase Advantage server V11 to communicate with the database. If i write a "é" in the account software, when i read it with the Advantage server, I read a ",".
The account software company seem to think that it was written with IBM codepage 850 but if I use ICLAND850 in Advantage server, i does not work.
After trying many different codepage in ADS, I dont seem to be able to find the right one.
I change the code page in the advantage server but do I have to change it elsewhere?
Is there a way or a software to detect the caracter set in DBF?
Upvotes: 1
Views: 918
Reputation: 14873
You have to set the AdsTableOptions.AdsCharType
in your TAdsQuery
and TAdsTable
components:
http://devzone.advantagedatabase.com/dz/webhelp/Advantage11/ade_adschartype.htm
The dynamic collations are only support for VFP-Tables so for the old DBF files you are dealing with you have to set this to either ANSI
or OEM
.
Depending on what kind of connection you are using (ALS or Remote server) the way to set up the correct ANSI/OEM codepage is different.
See also my answer to this question: Advantage Database Index Collation Sequence
It's possible to get the raw bytes used in the data using I would read the raw bytes from an example row and field that contains characters outside of ASCII and look them up in OEM/ANSI tables to find out the correct code page.TField.AsBytes
.
There are OEM and ANSI tables available on the web.
For example the é
character (which is Unicode $00E9
) is $82
in OEM 850:
http://demo.icu-project.org/icu-bin/convexp?conv=ibm-850_P100-1995&s=ALL
Upvotes: 3