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
IBDAC with Clientdatasets
-
salim_naufal
- Posts: 11
- Joined: Mon 30 Nov 2009 09:12
- Location: Lebanon
-
AndreyZ
Re: IBDAC with Clientdatasets
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.
-
salim_naufal
- Posts: 11
- Joined: Mon 30 Nov 2009 09:12
- Location: Lebanon
Re: IBDAC with Clientdatasets
Any idea for a time frame? I am forced to use Clientdataset in the application.
-
AndreyZ
Re: IBDAC with Clientdatasets
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.
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.
-
AndreyZ
Re: IBDAC with Clientdatasets
We have fixed this problem. This fix will be included in the next IBDAC build.
-
salim_naufal
- Posts: 11
- Joined: Mon 30 Nov 2009 09:12
- Location: Lebanon
Re: IBDAC with Clientdatasets
Thanks Andrey
Salim
Salim
-
AndreyZ
Re: IBDAC with Clientdatasets
Feel free to contact us if you have any further questions about IBDAC.