Page 1 of 1

FieldKind fkInternalCalc

Posted: Thu 05 Jun 2008 14:44
by giltonic
Hello,

It's very strange, the FieldKind "fkInternalCalc" (see Delphi Documentation) don't work with DataAccess Components for MySQL.

I know that it's a very strange kind of Field, But I need this !
The fkInternalCalc is for Field who are in the database but it's calculated fields !

Exemple :

Code: Select all

QsingleCALCFIELD:=TFloatField;
QsingleInternalCalc:=TFloatField;

And Properties

QsingleCALCFIELD.FieldKind:= fkCalculated;
QsingleInternalCalc.FieldKind:= fkInternalCalc;


procedure TForm1.QsingleCalcFields(DataSet: TDataSet);
begin
     
     QsingleCALCFIELD.Value:=QsingleMONTANTHT.Value*(1+QsingleTAUXTVA.Value/100);

     If Qsingle.State in [dsEdit,dsInsert] then QsingleInternalCalc.Value:=QsingleMONTANTHT.Value*(1+QsingleTAUXTVA.Value/100);

end;
QsingleCALCFIELD.Value is the good value

But QsingleInternalCalc.Value is always 0

Why ?

Posted: Fri 06 Jun 2008 07:57
by jkuiper_them
As far as I knows "fkInternalCalc" is only working with DBEXPRESS drivers.

Posted: Fri 06 Jun 2008 12:19
by giltonic
jkuiper_them wrote:As far as I knows "fkInternalCalc" is only working with DBEXPRESS drivers.
No, It's working very well with ZeosLib (Open source Lib) ! and so I don't understand why MyDac NOT !

Posted: Fri 06 Jun 2008 13:57
by Antaeus
If you set set the TCustomDADataset.Options.CacheCalcFields to True, all calculated fields will be calculated only once and cached in the dataset.