how do I access fields from OnCalcFields

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

how do I access fields from OnCalcFields

Post by albourgz » Mon 21 Nov 2016 16:28

c++ builder xe10
in .h I have

Code: Select all

TField *fQTIN;
in cpp:

Code: Select all

fQTIN=NULL;
QUniQuery->SQL->Text="SELECT ID, GETVALUEFUNCTION(ID) as QTYIN FROM atable";
QUniQuery->Active=true;
...
void __fastcall TForm1::QUniQueryCalcFields(TDataSet *DataSet)
{
    if (fQTIN==NULL) { fQTIN=DataSet->FieldByName("QTYIN");   }
}

¨

Problem: I get an exeception on fQTIN=DataSet->FieldByName("QTYIN"); (field not found).
Why why why?

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: how do I access fields from OnCalcFields

Post by MaximG » Wed 23 Nov 2016 14:32

Please specify how you create a calculated field . Do you create data fields for the ID and QTYIN attributes? Please provide a full code sample demonstrating TFields creation of the QUniQuery query in your project.

Post Reply