Reading Paradox tables via ODBC - Charset problem?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Stephan Schmahl
Posts: 2
Joined: Fri 13 Dec 2013 09:56

Reading Paradox tables via ODBC - Charset problem?

Post by Stephan Schmahl » Fri 13 Dec 2013 10:57

Our current project is a BDE migration.

The first step is to substitute all BDE components (TDatabase, TTable, TQuery, etc.) by corresponding UniDAC components.

While step 2 - choosing the right database for our needs in order to substitute Paradox - is in progress we want to access the old Paradox tables by using UniDAC.

I created an ODBC datasource using "Microsoft Paradox Driver (*.db )" and our TUniConnection component connected successfully by setting Provider=ODBC and Server=[our ODBC DSN].

A TUniTable could also opened successfully but displaying the table data in a TDBGrid results in not showing german Umlaute (ä, ö, ü) correctly.

I tried to set the charset manually by writing

Code: Select all

UniConnection1.SpecificOptions.Values['Charset'] := 'Latin-1';
but got no improvements. Also various other charset identifiers did not help.

What am I missing?

Thanks in advance!
Stephan

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Reading Paradox tables via ODBC - Charset problem?

Post by AlexP » Fri 13 Dec 2013 11:37

Hello,

For correct work with UniCode symbols, you should set the UseUnicode property to True:

Code: Select all

UniConnection1.SpecificOptions.Values['UseUnicode'] := 'True';

Stephan Schmahl
Posts: 2
Joined: Fri 13 Dec 2013 09:56

Re: Reading Paradox tables via ODBC - Charset problem?

Post by Stephan Schmahl » Fri 13 Dec 2013 12:27

I forgot to mention that we use Delphi 2007 on Windows 7 Enterprise 32-Bit and Paradox 5 tables.

We don't use UniCode and unfortunatelly your suggestion did not help either.

The standard BDE alias has no problems reading the data. For me it looks more like a ANSI/ASCII problem though I have no idea why UniDAC should read or display the data differently.

We investigated further and using the following function helps to get data from single cells right:

Code: Select all

function AnsiToAscii(AAnsiStr: String): String;
begin
  Result := AAnsiStr;
  if Length(Result) > 0 then
    CharToOem(PChar(AAnsiStr), PChar(Result));
end;
However this does not solve the problem of incorrect grid display.

Any other ideas?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Reading Paradox tables via ODBC - Charset problem?

Post by AlexP » Mon 16 Dec 2013 09:00

Hello,

Please send your table file to alexp*devart*com

Post Reply