Board index » delphi » Bug? TADOQuery FieldValues['SomeDoublePrecisionValue'] returns Integer
Dennis Reichel
![]() Delphi Developer |
Bug? TADOQuery FieldValues['SomeDoublePrecisionValue'] returns Integer2004-06-12 05:50:42 AM delphi231 Hello, I have encountered some unexpected behavior with Delphi 7 Pro and Delphi 7 Pro with the 7.1 update that I'd like help understanding. Invoices: TADOQuery; CreditAmountNeeded: Currency; {Invoices is a parameterized query on a customer ID field:string} with Invoices do begin // ShowMessageFmt('Just FieldValues: %f',[FieldValues['AppliedAmount']]); // Exception - %f specifier not supported for data type // NB: error didn't show up in early testing because Min and Max accepted an Integer type value without complaining!!! CreditAmountNeeded:=Max(0,FieldValues['AppliedAmount']-UnusedPayment); ShowMessageFmt('With FieldValues: %f',[CreditAmountNeeded]); // shows 133.00 <>the correct value CreditAmountNeeded:=Max(0,FieldByName('AppliedAmount').AsCurrency - UnusedPayment); ShowMessageFmt('With FieldByName: %f',[CreditAmountNeeded]); // shows 133.33 = the correct value Extracting the FieldValues['AppliedAmount'] (read from a Ms Access db on the local machine - Win2k SP4) seems to return the field value truncated to integer. Is this reproducible/documented/intended behavior? Some time ago I had some runtime errors reading DateTime fields using FieldValues['fieldname'] that in hindsight must have been from assigning integer values where TDateTime was expected. Also, where is the bug reporting facility on the Borland site? (is there one?) How do you tell if the Delphi 7.1 update is installed properly (other than accepting the word of the installation program) Many Thanks in Advance, Dennis Reichel |