Problems with TINYINT field v6.10.20
Posted: Fri 04 Jul 2014 14:08
For a Delphi 7 application I've upgraded SDAC from 6.8.19 to 6.10.20. I use persistent fields. One of those fields (type tinyint) has per row the value 0 or 1. After the update I got errors and while debugging I encountered values existing of 5 numbers like 25856 or 30208. The result from TMSQuery in the IDE is correct, but when I got the data in a ClientDataSet (via a DataSetProvider) in a DBGrid the values are wrong. When writing to the table I get errors like "Arithmetic overflow error for data type tinyint, value = 25856" (of course).
I changed the field from tinyint to integer. Then the problem in the ClientDataSet was gone, I got in the DBGrid the values 0 and 1 as expected.
After that I went back to SDAC 6.8.19 and the tinyint field and also the problem was gone, same expected results 0 and 1.
After that I went to Delphi 2010 and build a simple test application for the same table. I managed to make persistent fields for the TMSQuery with the tinyint field, but for the ClientDataSet it was impossible to add the tinyint field as persistent field. I only could manage to make the field as persistent field when again I changed the tinyint field to an integer field.
With version 6.8.19 the tinyint fields are persistent fields of type TSmallintField (in Delphi 7 and 2010).
So it looks that something is wrong with tinyint in 6.10.20 in communication to a ClientDataSet.
Specs:
Windows 7 prof.
Delphi 7 and Delphi 2010
SDAC 6.10.20
MS SQL Server 2008 R2
I changed the field from tinyint to integer. Then the problem in the ClientDataSet was gone, I got in the DBGrid the values 0 and 1 as expected.
After that I went back to SDAC 6.8.19 and the tinyint field and also the problem was gone, same expected results 0 and 1.
After that I went to Delphi 2010 and build a simple test application for the same table. I managed to make persistent fields for the TMSQuery with the tinyint field, but for the ClientDataSet it was impossible to add the tinyint field as persistent field. I only could manage to make the field as persistent field when again I changed the tinyint field to an integer field.
With version 6.8.19 the tinyint fields are persistent fields of type TSmallintField (in Delphi 7 and 2010).
So it looks that something is wrong with tinyint in 6.10.20 in communication to a ClientDataSet.
Specs:
Windows 7 prof.
Delphi 7 and Delphi 2010
SDAC 6.10.20
MS SQL Server 2008 R2