TFMTBCDField.Precision Problems??

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wiseinfo
Posts: 7
Joined: Wed 23 Sep 2009 04:05

TFMTBCDField.Precision Problems??

Post by wiseinfo » Wed 23 Sep 2009 05:12

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 23 Sep 2009 08:23

TClientDataSet does not support precision more than 32.

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

wiseinfo
Posts: 7
Joined: Wed 23 Sep 2009 04:05

Post by wiseinfo » Wed 23 Sep 2009 10:31

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}

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 24 Sep 2009 14:22

Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.

Post Reply