Page 1 of 1

TFMTBCDField.Precision Problems??

Posted: Wed 23 Sep 2009 05:12
by wiseinfo
DataBase:SQL Server 2000
UniQuery+DataSetProvider+ClientDataSet,

QTY field is Numeric(12,2)

UniQuery.SQL.Text:='Select goodsid,sum(qty) from OrderDetail group by goodsid';


TFMTBCDField(UniQuery.FieldByName('qty')).Precision is 38

but TFMTBCDField(ClientDataSet.FieldByName('qty')).Precision is 32,

ClientDataSet qty field value is not correct or wrong

Posted: Wed 23 Sep 2009 08:23
by Plash
TClientDataSet does not support precision more than 32.

Please specify what is correct value of the field and what value you get in TClientDataSet.

Posted: Wed 23 Sep 2009 10:31
by wiseinfo
Plash wrote:TClientDataSet does not support precision more than 32.

Please specify what is correct value of the field and what value you get in TClientDataSet.
any value,if sum Numeric(Decimal) field ,sorry,my english is very poor!

you can test ,but ClientDataSet.Fieldbyname('f1').value is 0.5,is error
Select cast(1 as numeric(38,2)) as F1

midas.dll not can change,i'm now change OLEDBAccessUni.pas is ok!!!

procedure TOLEDBRecordSet.InternalInitFields;
...............
{$IFDEF VER6P}
{$IFNDEF FPC}
dtFmtBCD:
begin
//Wise Fix
if Precision>32 then
Field.Size:=32
else if Precision 32 then
Field.Length:=32;
end;
{$ENDIF}
{$ENDIF}

Posted: Thu 24 Sep 2009 14:22
by Dimon
Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.