Board index » delphi » Dynamically adding a field to a dataset

Dynamically adding a field to a dataset

How do I dynamically add a field to a dataset that I can assign a string
value to?
 

Re:Dynamically adding a field to a dataset


var
    MyField : TField
begin
    MyField := TStringField.Create(Ancestor);
    Qry.Fields.Add(MyField)
end

The "problem" is that you must add all the field that you need at run time.

Brian Gillespie a crit dans le message <3a6f5c13_2@dnews>...

Quote
>How do I dynamically add a field to a dataset that I can assign a string
>value to?

Re:Dynamically adding a field to a dataset


thanks...I'll try that.

Quote
"Francis Dupont" <francis_dup...@hotmail.com> wrote in message

news:3a8a8ed8$1_1@dnews...
: var
:     MyField : TField
: begin
:     MyField := TStringField.Create(Ancestor);
:     Qry.Fields.Add(MyField)
: end
:
: The "problem" is that you must add all the field that you need at run
time.
:
:
: Brian Gillespie a crit dans le message <3a6f5c13_2@dnews>...
: >How do I dynamically add a field to a dataset that I can assign a string
: >value to?
: >
: >
:
:

Other Threads