FieldKind fkInternalCalc

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
giltonic
Posts: 3
Joined: Thu 05 Jun 2008 14:28

FieldKind fkInternalCalc

Post by giltonic » Thu 05 Jun 2008 14:44

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 ?

jkuiper_them
Posts: 28
Joined: Thu 20 Dec 2007 14:48

Post by jkuiper_them » Fri 06 Jun 2008 07:57

As far as I knows "fkInternalCalc" is only working with DBEXPRESS drivers.

giltonic
Posts: 3
Joined: Thu 05 Jun 2008 14:28

Post by giltonic » Fri 06 Jun 2008 12:19

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 !

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 06 Jun 2008 13:57

If you set set the TCustomDADataset.Options.CacheCalcFields to True, all calculated fields will be calculated only once and cached in the dataset.

Post Reply