[DUG] Creating fields at runtime

Alister Christie alister at SalesPartner.co.nz
Tue May 31 13:29:10 NZST 2005


I'm creating a TQuery (descriptively called q) at runtime with a with a 
query such as "select * from contact".  However I want to add a 
calculated field to this using the following code
     strfield := TStringField.Create(q);
     strfield.FieldName := 'RequirementsDesc';
     strfield.FieldKind := fkCalculated;
     strfield.DataSet := q;
However, by adding a calculated field I hide all the fields in the 
fielddefs.  Does anyone know of a way around this, either by putting the 
calculated field in q.fielddefs or adding all the fields to q.fields in 
some easy fashion


-- 
Alister Christie
Computers for People
Ph: 04 471 1849 Fax: 04 471 1266
http://www.salespartner.co.nz
PO Box 13085
Johnsonville
Wellington


More information about the Delphi mailing list