Page 1 of 1

IBDAC with Clientdatasets

Posted: Thu 18 Jul 2013 07:10
by salim_naufal
I am having a problem with Numeric(18,2) Firebird datatypes working properly when using IBDac with Clientdatasets.
I have verified that the problem occurs with Delphi 7 and Delphi 2009.

This is how the problem can be reproduced:
Using Firebird 2.5.X, create a database Dialect 3.
Create any table with a numeric(18,2) field and fill in data.
In a blanc delphi project, use an IBCConnection, IBCQuery, Datasetprovider, Clientdataset, Datasource, then a simple dbEdit to show the value of that field.

In the options of the IBCConnection, set EnableBCD = True and EnableFMTBCD = True.

In design time, open the clientdataset:
In Delphi 7, I get a BCD overflow
In Delphi 2009, the DBEdit component shows 0 although there are values that are non zero.

Connecting the DBEdit directly to the IBCQuery shows the correct values.

Setting in the database options EnableBCD = False works fine however, according to the IBDac help system, the EnableFMTBCD is for large integer values and not numeric(18,2) types.

Any help is appreciated.

Thanks
Salim

Re: IBDAC with Clientdatasets

Posted: Thu 18 Jul 2013 12:07
by AndreyZ
We know about this problem. It is caused by the fact that the TClientDataSet component uses a different format of BCD and FMTBCD field values than IBDAC. We will try to get round this problem in one of the next IBDAC versions. For the time being, the only workaround is to use IBDAC components directly without using the TClientDataSet component.

Re: IBDAC with Clientdatasets

Posted: Thu 18 Jul 2013 12:27
by salim_naufal
Any idea for a time frame? I am forced to use Clientdataset in the application.

Re: IBDAC with Clientdatasets

Posted: Fri 19 Jul 2013 08:41
by AndreyZ
For the time being, you should set the EnableBCD property to False and the EnableFMTBCD property to True. In this case, there will be no problems with NUMERIC(18,2) field type in any Delphi version.
Please note that TBCDField fields cannot work with big precisions. If you use values with big precisions in TBCDField fields, you may obtain the "BCD Overflow" error. That is the correct behaviour.
If you need to work with big precisions, you should use TFMTBCDField fields.
We will fix the problem when NUMERIC field values are returned as zero values when EnableBCD is set to True. We will try to do this in the nearest IBDAC build.

Re: IBDAC with Clientdatasets

Posted: Mon 29 Jul 2013 09:42
by AndreyZ
We have fixed this problem. This fix will be included in the next IBDAC build.

Re: IBDAC with Clientdatasets

Posted: Mon 29 Jul 2013 10:05
by salim_naufal
Thanks Andrey

Salim

Re: IBDAC with Clientdatasets

Posted: Mon 29 Jul 2013 10:08
by AndreyZ
Feel free to contact us if you have any further questions about IBDAC.