FieldByName on SmallInt Column returns wrong value
Posted: Tue 03 May 2011 07:18
I’ve got the following problem:
I work with Database Firebird 2.1, a Table with a column with type SMALLINT.
The selected Record has a value of -14000 in the SMALLINT column.
The select with TIBCQUERY works fine, if I read out the value with IBCQuery1.FieldByName('FIELD1').AsInteger it returns -14000.
Now I define persistent Fields in the Fieldeditor. The special is that the SMALLINT Column FIELD1 is defined in Delphi as a TIntegerField. If I now read out the value with IBCQuery1.FieldByName('FIELD1').AsInteger it returns a wrong Value 51536.
Devart IBDAC 3.10.0.16 for Delphi 2007 for Win32
Note: Because there are several databases with different definitions, means INTEGER or SMALLINT in the Column FIELD1. So it's just not possible to change the source code to TsmallIntField.
Is there a way to solve this problem?
Greetings
I work with Database Firebird 2.1, a Table with a column with type SMALLINT.
The selected Record has a value of -14000 in the SMALLINT column.
The select with TIBCQUERY works fine, if I read out the value with IBCQuery1.FieldByName('FIELD1').AsInteger it returns -14000.
Now I define persistent Fields in the Fieldeditor. The special is that the SMALLINT Column FIELD1 is defined in Delphi as a TIntegerField. If I now read out the value with IBCQuery1.FieldByName('FIELD1').AsInteger it returns a wrong Value 51536.
Devart IBDAC 3.10.0.16 for Delphi 2007 for Win32
Note: Because there are several databases with different definitions, means INTEGER or SMALLINT in the Column FIELD1. So it's just not possible to change the source code to TsmallIntField.
Is there a way to solve this problem?
Greetings