Page 1 of 1

SQL Server float to Real field conversion bug

Posted: Wed 06 Nov 2013 04:47
by Tokha
Hello!

Delphi XE2
UniDAC 5.1.4
Table on MS SQL Server 2005 Express with two fields of REAL type wich stores float values from Delphi TDateTime type.

After upgrade UniDAC version our old project has been fixed with adding Data Type Mapping to Float in UniQuery designer.

Now when Insert values of Delphi TDateTime type (in mean of Date part) into these REAL fields we have not expected results:
Delphi TDateTime: 41584.7093669676 (is right)
Query parameter value from DBMonitor: -3.68934881474191E19 (is wrong)
Actual field value after insert: -3.68934881474191E19 (is wrong)
This behaviour presents for both FieldByName(...).AsFloat and FieldByName.Value assigns.

AsSingle not works (writes 0 instead any actual values).

With old version of UniDAC (is not recognized what actual was) all was clear and works.

What happend with actual float value before it passed to query parameter? How to fix this behaviour?

Re: SQL Server float to Real field conversion bug

Posted: Thu 07 Nov 2013 01:41
by Tokha
Problem was solved when all field definitions TFloatField in dfm & pas was changed to TSingleField and Data Type Mapping was removed.

But I guess it's not quite right way.

Re: SQL Server float to Real field conversion bug

Posted: Thu 07 Nov 2013 13:09
by AndreyZ
Thank you for the information. We have fixed this problem. This fix will be included in the next UniDAC build.