Skip to main content

I can’t get the connection string to work with charset ie.

 

DataSource=myaccesdb;Charset=windows-1252;

 

The connection is fine, but Charset has no effect. Has anyone solved this?

Hi ​@Mortensp 

The Charset property is not a visible connection configuration that is why it will not work the way you have defined it. You can use our Charset connection property by passing it in the Other property, in order to use a different encoding with the driver. 

Other=Charset=windows-1252

 

Kindly give this a try and let us know if it works.


If I’ve understud you right my connection string should be:

    string connectionString = @"DataSource=.\BMDB_Section_1222.bws;Other=Charset=Windows-1252";

That doesn’t work either. And Charset is not listet as an option on Other i the documentation


@Mortensp 

That’s odd. Normally setting Charset=ISO-8859-1 or Charset=Windows-1252 should resolve any issues with encoding. Would you be able to provide more information about the use case here? Is the access file a non-Unicode or does it only contain some characters in it’s content with different encoding?

On the second point, not all hidden connection properties are included in the documentation. However to get a list of the hidden connection properties you can run a query as follows:

SELECT * FROM sys_connection_props WHERE Visible=False

 

You might want to submit a support ticket in the CData portal and include any relevant details so that one of our support specialists can look into the matter and provide next steps.