Page 1 of 1

Problems with field name that contain accented characters

Posted: 31.01.2019, 16:24
by tkszeos
Hello,
I have a problem and I hope I can explain myself.
In an old Firebird 1.5 database I have a field whose name is "Città".
By connecting TZQuery via a TDataSource to a DBGrid I see the field value correctly. The field name is seen as "Citt"
I create a TZQuery.BeforePost event

Code: Select all

procedures TForm1.ZQuery1BeforePost (DataSet: TDataSet);
begin
   ZQuery1.FieldByName ('Citt'). Value: = 'Rome';
end;
but I get the following error:
SQL Error: Dynamic SQL Error; SQL error code = -206; Column unknown; Citt; At line 1, column 15..

If instead I use the following code:

Code: Select all

procedures TForm1.ZQuery1BeforePost (DataSet: TDataSet);
begin
   ZQuery1.FieldByName ('Città'). Value: = 'Rome';
end;
I get the following other error:
TZQuery1: Field not found: "Città"

If TZConection.ClientCodePage = NONE and TZQuery is connected to a TUpdateSQL and the property ModifySQL is set to

Code: Select all

UPDATE "BOLHDR" SET
  "Città" = :"Citt"
WHERE
  "BOLHDR"."ID_BOL" = :OLD_ID_BOL
the field is updated correctly.

I'm wrong, is it a bug or a correct behavior?

The problem is present both in Delphi 7 and Lazarus

Thanks for the reply