UTF8 and ADO-Connection
Posted: 21.07.2014, 17:15
Hi all,
I am using ZeosLib 7.1.3a with Delphi 2010 and want to write some UTF8 characters into a Memo-Field of an Access-DB connected via ADO. But I cannot get this working. E.g. the character Ĉ will be stored as C, while the german Umlauts äüöß are correct. Can anybody tell me, how TZConnection must be configured to get this working? Currently I use the following settings:
Connection.Properties.Text := 'codepage=utf8';
Connection.ControlsCodePage := cCP_UTF8;
Connection.ClientCodepage := 'utf8';
Connection.Protocol := 'ado';
Connection.Port := 0;
Connection.Database := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + dbFile + ';Persist Security Info=False;Jet OLEDB:Database Password=' + sDecrypt(AccessPW) + ';Mode=Share Deny None';
Connection.HostName := '';
Connection.User := '';
Connection.Password := '';
...
Connection.ExecuteDirect(t)
Where t is 'update table set col=''äöüßĈ'' where id=1234'
Does the Memo already contain some UTF8-chars, I can read same with this connection without problems, but I cannot write them. Any Ideas?
PS: The program works well with a MySQL-Database, but not Access via ADO.
Has anybody an idea how to solve this problem?
Best regards
Peter
I am using ZeosLib 7.1.3a with Delphi 2010 and want to write some UTF8 characters into a Memo-Field of an Access-DB connected via ADO. But I cannot get this working. E.g. the character Ĉ will be stored as C, while the german Umlauts äüöß are correct. Can anybody tell me, how TZConnection must be configured to get this working? Currently I use the following settings:
Connection.Properties.Text := 'codepage=utf8';
Connection.ControlsCodePage := cCP_UTF8;
Connection.ClientCodepage := 'utf8';
Connection.Protocol := 'ado';
Connection.Port := 0;
Connection.Database := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + dbFile + ';Persist Security Info=False;Jet OLEDB:Database Password=' + sDecrypt(AccessPW) + ';Mode=Share Deny None';
Connection.HostName := '';
Connection.User := '';
Connection.Password := '';
...
Connection.ExecuteDirect(t)
Where t is 'update table set col=''äöüßĈ'' where id=1234'
Does the Memo already contain some UTF8-chars, I can read same with this connection without problems, but I cannot write them. Any Ideas?
PS: The program works well with a MySQL-Database, but not Access via ADO.
Has anybody an idea how to solve this problem?
Best regards
Peter