Page 1 of 1
How to use unicode with TEntityConnection?
Posted: Fri 17 Jun 2016 16:49
by rodrigobarbosa
Hello everyone,
I use latin charset with unicode, so, have anyone set unicode within the connection string for TEntityConnection?
Re: How to use unicode with TEntityConnection?
Posted: Mon 20 Jun 2016 08:58
by AlexP
Hello,
To work with Unicode characters, you simply need to add the Useunicode parameter in the ConnectionString:
Code: Select all
EntityConnection1.ConnectionString: = EntityConnection1.ConnectionString + '; UseUnicode = True';
Re: How to use unicode with TEntityConnection?
Posted: Mon 20 Jun 2016 13:18
by rodrigobarbosa
I have tried and it returns this error message
Connection parameter name is unknown: UseUnicode
Re: How to use unicode with TEntityConnection?
Posted: Tue 21 Jun 2016 09:36
by AlexP
What EntityProvider and database are you using?
Re: How to use unicode with TEntityConnection?
Posted: Tue 21 Jun 2016 11:27
by rodrigobarbosa
I use uniDAC connecting to postgres database, don“t know if it matters but the connection changes between two different server with postgres 9.1 and 9.5, but both give me the same message.
I tried change the connection string to use PgDac as found in the documentation, however, the company seens to not have it installed.
Re: How to use unicode with TEntityConnection?
Posted: Mon 27 Jun 2016 08:44
by AlexP
Thank you for the information. We have reproduced the problem in the UniDAC Provider and will try to fix it as soon as possible.
Re: How to use unicode with TEntityConnection?
Posted: Wed 29 Jun 2016 12:25
by bork
If you use UniDAC as data provider, you should specify ProviderName, because UniDAC allows connection to various databases. In your case, this connection string is valid:
Code: Select all
EntityConnection.ConnectionString := 'Data Provider=UniDAC;ProviderName=PostgreSQL;SQL Dialect=PostgreSQL;UseUniCode=True;Server=your_server;Port=5432;User=your_user;Password=your_password';
Please specify the connection string that you are using to establish connection via PgDAC.
Re: How to use unicode with TEntityConnection?
Posted: Wed 29 Apr 2020 11:38
by Isaev
Did you fix this problem?
I have PostgreSQLUniProvider and EntityConnection
and if I use
UseUniCode=True in
EntityConnection.ConnectionString it returns the same message
Connection parameter name is unknown: UseUnicode
and without unicode
Code: Select all
var
Query: ILinqQueryable;
begin
Query := Linq.From(EntityContext1['abk']).Select;
edsABK.SourceCollection := EntityContext1.GetEntities(Query);
edsABK.Open;
end;
by Open:
character with byte sequence 0xc3 0xbc in encoding "UTF8" has no equivalent in encoding "WIN1251"
Or how can I PgDAC as a EntityConnections DataProvider to use?
In the list of ProviderName I do not see it...
EntityDAC v2.3.4
PostgreSQL 9.6
Re: How to use unicode with TEntityConnection?
Posted: Wed 29 Apr 2020 19:29
by MaximG
As we said earlier, the error is caused by the missing parameter ProviderName, which is required when you use UniDACDataProvider.
Please verify that your connection string contains this parameter:
Code: Select all
EntityConnection.ConnectionString := 'ProviderName=PostgreSQL;Data Provider=UniDAC;SQL Dialect=PostgreSQL;Data Source=... ...';
Re: How to use unicode with TEntityConnection?
Posted: Thu 30 Apr 2020 09:18
by Isaev
The problem is that we cannot to install at the same time EntityDAC and PgDAC because the both pgdac use, however, different versions of it and they stand always during the conflict!
This prevents you from setting TPgDACDataProvider as a visual component, you have to spell in the code
Code: Select all
EntityConnection1.ProviderName := 'PgDAC';