I've got PostgresQL 9.1 running on Linux machine, and I'm connecting to it using Delphi XE with Zeos 7.0.0-dev.
My Database works in UTF8, additionally I'm setting the following properities in TZConnection:
Code: Select all
con.Properties.Add('codepage=utf8');
con.Properties.Add('lc_all=Polish_Poland.utf8');
Code: Select all
sql.sql.Add('insert into dziennik(login,wpis,data) values (:LOGIN, :WPIS, NOW())');
sql.Prepare;
sql.ParamByName('LOGIN').AsString := 'dbtest';
sql.ParamByName('WPIS').AsString := edtLogin.Text;
sql.ExecSQL;
Just to be sure it's ParamByName problem: I'v tested it using (in the same unit) the following code:
Code: Select all
sql.sql.Clear;
sql.sql.Add('insert into dziennik(login,wpis,data) values (''dbtest'', ' + QuotedStr(edtLogin.Text) + ', NOW())');
sql.ExecSQL;
best regards,
Cezar