Subject | Re: [IBO] IBOQuery: How to create TField for selected fieldsatruntime? |
---|---|
Author | Helen Borrie |
Post date | 2005-02-05T01:42:01Z |
At 05:22 PM 4/02/2005 -0800, you wrote:
not TField objects, but descendants of TField, like TStringField,
TIntegerField, and so on. The Borland help says TField objects should not
be created directly, so I'd expect something to go wrong. Even if it was
allowed, I don't know how you would bind such an array to a
dataset; perhaps an assignment of like types might work....if it did, you
would still have to iterate through all the essential properties and set
them. It all sounds like one heck of a lot more work than using persistent
fields arrays.
Helen
>Hi, Helen:I'd be surprised if that would work, since TField instatiated classes are
>
>Thanks again.
>
>I'm afraid my own ignorance about all this is showing. Frankly, what
>reading I've
>done only confuses it more. I guess I was using the word
>persistent/non-persistent
>incorrectly.
>
>I guess I need to ask, "How do I instantiate the TField for a runtime created
>IBOQuery/TDataset?" Simply referring to the FieldByName('fieldname')
>doesn't do
>it. I'm trying to avoid have a bunch of IBOQuery components all over my
>Datamodule
>for every little query I do.
>
>As I'm writing, I'm thinking the problem may be here:
>
>I'm declaring an array of TFields. Then assigning each with FieldByName(),
>but I
>guess I need to do something like the following:
>
>FieldArray[i] := TField.Create;
>Then assign the FieldByName.
>
>Is this correct?
not TField objects, but descendants of TField, like TStringField,
TIntegerField, and so on. The Borland help says TField objects should not
be created directly, so I'd expect something to go wrong. Even if it was
allowed, I don't know how you would bind such an array to a
dataset; perhaps an assignment of like types might work....if it did, you
would still have to iterate through all the essential properties and set
them. It all sounds like one heck of a lot more work than using persistent
fields arrays.
Helen