[DUG] Creating fields at runtime

Todd Martin toddm at kol.co.nz
Wed Jun 1 01:48:33 NZST 2005


Are your existing fields in the dataset create at design time?

----- Original Message ----- 
From: "Alister Christie" <alister at salespartner.co.nz>
To: "NZ Borland Developers Group - Delphi List" <delphi at ns3.123.co.nz>
Sent: Tuesday, May 31, 2005 1:29 PM
Subject: [DUG] Creating fields at runtime


> 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
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
> 
>


-- 
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 266.11.15 - Release Date: 22/05/2005



More information about the Delphi mailing list