Problem with string parameter of TZQuery

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
CoMPi
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 11.01.2009, 22:03

Problem with string parameter of TZQuery

Post by CoMPi »

I have a problem with ZeosLib 7.0 + MySQL + Delphi 2009 Pro.
I noticed that assigning a unicode value to a string parameter of TZQuery is not correct. To be more precise I give an example:

// query with parameter
qry.SQL.Text := 'INSERT INTO MyTable (StringField) VALUES (:AStringParam)';
qry.ParamByName('AStringParam').AsString := 'ąćń';
qry.ExecSQL;

After that in the table I have some strange characters. But if I execute something like this:

// query without parameter
qry.SQL.Text := 'INSERT INTO MyTable(StringField) VALUES (''ąćń'')';
qry.ExecSQL;

the content of the table is correct. What is wrong with my code?

Thank you in advance
CoMPi
Locked