Subject | Re: [IBO] aggregate fields? Persistant fields? |
---|---|
Author | James |
Post date | 2004-03-22T00:37:45Z |
Hi Paul
Paul Vinkenoog wrote:
something like what you have done here, but it sounds great =). May I
know what is the advantage of using the FieldByName over the
colName=qryPersons->FieldByName("name");? You mention that in that in
loops this could make ther performance better.
assign all the fields that I will be using in afterprepare event? and
declare a TIB_Column variable for each field that I will be using?
Regards,
james
Paul Vinkenoog wrote:
> Fields are "persistent" from the moment the dataset is prepared untilIam following this thread to learn more about IBO. I am surprise to see
> it is unprepared. What I often do (in C++ Builder) is the following.
> Suppose I have a query qryPersons returning two columns: Name and
> Address. I don't want to use FieldByName all the time and in loops it
> could even slow things down. So I make an AfterPrepare handler for the
> query with this code (or calling a function with this code):
>
> ...
> colName = qryPersons->FieldByName( "Name" );
> colAddr = qryPersons->FieldByName( "Address" );
> ...
something like what you have done here, but it sounds great =). May I
know what is the advantage of using the FieldByName over the
colName=qryPersons->FieldByName("name");? You mention that in that in
loops this could make ther performance better.
>am I right to say that if I'll be using this kind of technique I have to
> ...colName and colAddr being TIB_Column* fields of the Form (or global
> variables, depending on the situation).
>
> Upon unprepare, they should be reset to NULL (nil in Delphi). Actually
> I use the same function for that, called with a parameter from the
> AfterPrepare handler.
>
> Now if I need to access those fields in my code I just do:
>
> HisName = colName->AsString;
> colAddr->AsString = "27 Penny Lane";
assign all the fields that I will be using in afterprepare event? and
declare a TIB_Column variable for each field that I will be using?
Regards,
james