Subject Re: [IBO] IBOQuery: How to create TField for selectedfieldsatruntime?
Author Chuck Belanger

OK, I guess I just don't understand what you're talking about.

[ It all sounds like one heck of a lot more work than using persistent
fields arrays.]

What are "persistent field arrays"? How do I go about making them at runtime?

Please remember that what I'm trying to do is assign the OnGetText event to
specific fields in multiple tables. I'd like it flexible enough to not have to do
this by adding components to the DM and then creating TField objects via the IDE,
but allow my database dictate which fields will have the OnGetText/OnSetText
assigned. This is all to encrypt and decrypt the db fields.

Perhaps I'm just going about this all the wrong way? Thanks again for all your



p.s. you're right the FieldArray[i] := TField.Create; didn't work at all. Still
tells me that the Field does not exist.

Helen Borrie wrote:

> At 05:22 PM 4/02/2005 -0800, you wrote:
> >Hi, Helen:
> >
> >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?
> I'd be surprised if that would work, since TField instatiated classes are
> 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
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links