Encoding problems with C# .NET OLEDB connection to a Paradox database

Swedish characters åäö are replaced with Õõ÷ and so on after retrieving
data from the OleDbDataAdapter.

This is my connection string

string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sPath + ";Extended Properties=Paradox 5.x;";


And this is my query code

             OleDbDataAdapter oleAdapter = new OleDbDataAdapter(sQuery, oleConection);
                                                               
                DataSet dsRetrievedData = new DataSet();
                oleAdapter.Fill(dsRetrievedData);
               
                this.dataGridView1.DataSource = dsRetrievedData;
                this.dataGridView1.DataMember = dsRetrievedData.Tables[0].TableName;

I have generally just looped thru the dataset and
wrote data to files and/or showed them as message.
I have also tried fill it to a datagridview but characters are always
wrong....

help me pleease...
LVL 1
daniferAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

daniferAuthor Commented:
I have also tried using ODBC in .NET but with the same results.
0
pcelbaCommented:
My answer probably does not help but it just could mean the Paradox database has no Code page or its Code page is not compatible with .NET environment. Do you know what Code page is used in Paradox db?

Some ideas for BDE are mentioned here: http://www.tek-tips.com/viewthread.cfm?qid=811791&page=31 but it probably does not help.
Also the following link does not help most probably: http://www.thedbcommunity.com/index.php?option=com_content&task=view&id=234&Itemid=44

You could also try to download newer Microsoft ACE.OLEDB.12 driver: http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en (I am pesimistic again...)

Another possibility is to write your own converter and use it in .NET or export Paradox data into different format (e.g. DBF) and use this format.
0
daniferAuthor Commented:
Thanks for your answers.

Not 100% sure of the codepage but I have tried viewing it with all sorts of possible codepages without any luck.

First links Ive already looked at since I've been goggling this for 2 weeks now.

It seems like it´s an issue between the communication between the driver/oledb and the paradox.
Since I've tried converting the arriving data from all types of encoding types to utf8 and what not,
without success. Seems like .NET converts the data before my code but not doing a good job at it  and resulting in "corrupt" data.

I haven't looked on that new driver. Does it really apply to paradox databases?

At this moment I have did the worst hack; replacing the wrong characters to their counterparts...but this isn't a solution for characters has become characters that are encoded correctly..so this is really not an option.... =)
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

pcelbaCommented:
The new driver supports Paradox but the level of implementation is probably same as in the old one. Microsoft released even one more driver for Office 2010 but it is still in beta.

Are you able do retrieve character codes from Paradox database and compare them to .NET ones? It could just be wrong font used but if the .NET characters are stored in Unicode strings then the problematic part is most probably the driver. Also what is your local settings in Windows?
0
daniferAuthor Commented:
According to Paradox Viewer (http://www.shareup.com/Paradox_viewer-download-22359.html) these tables are encoded in ANSI (windows codepage).

I have tried converted these as ANSI to UTF8 so that that doesn't help.

The only worrying thing is that this tool is reporting that the table version is 7.0
while I use 5.x in the connectionstring. I have not seen a connectionstring that
works with 7 though.

I only need read-access so it wouldn´t be a problem to use some driver that only supports this.

With local settings you mean?
I use english Win7 with swedish locale settings.
0
pcelbaCommented:
Swedish locale should be OK.

It seems you'll need to test different ODBC driver. Microsoft does not support Paradox ver. 7 but who knows what is the difference to ver. 5 in DB format.

Paradox ODBC driver was included in Paradox package:
Paradox 9 shipped with it's Paradox ODBC driver. That driver works with all the Paradox table structures include Paradox 4 and 7 structures. Microsoft and others also have developed Paradox ODBC drivers but to the best of my knowledge, ONLY the one that shipped with Paradox 9 supports the latest Paradox 7 table structure (that's the same table structure use in Paradox for Windows versions 7, 8, 9, 10, 11, 12, and the current 13.

Here is also some Paradox ODBC driver available:
http://sandbox.mainframe-connection.com/products/odbc/odbcoverview/index.htm

DataDirect offers professional drivers, you could try some trial version after registration:
http://www.datadirect.com/downloads/main-registration-form/mainregform/index.html?atc=DDWBDNLDCOWin
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
daniferAuthor Commented:
I'm gonna try the DataDirect drivers and then see how expensive they are :)
0
daniferAuthor Commented:
DataDirect drivers returns text in correct encoding :] Happy days. Lets hope they aren´t too expensive. Thanks.
0
pcelbaCommented:
Hmm, they do not seem cheap... 5 users pack of something for $600.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.