Subject | RE: [IBO] LookupKeyForFields vs. LookupKeyForBufferFields |
---|---|
Author | Jason Wharton |
Post date | 2006-04-05T06:46:50Z |
Each of these methods do essentially the same thing except the result is
placed either in the Fields array or the BufferFields arral. The nice thing
about doing LookupKeyForBufferFields is there isn't a requirement to
position the record pointer to a valid row in the dataset buffers. It can
simply pull the record into the buffer and flag it as sitting on an invalid
row number. You get to look at the data of the row but you don't have to
naviagte the dataset record pointer to it within the context of the dataset
buffer.
In either case, you have to plug the value you are looking for in the
KeyFields array. If you don't know how to use the undocumented, internal
methods, I suppose this is the only place you can figure that out. Keep in
mind, I really prefer you just use the standard Locate() method but I'll
help as many as I can flex all the muscle possible in IBO.
Jason
placed either in the Fields array or the BufferFields arral. The nice thing
about doing LookupKeyForBufferFields is there isn't a requirement to
position the record pointer to a valid row in the dataset buffers. It can
simply pull the record into the buffer and flag it as sitting on an invalid
row number. You get to look at the data of the row but you don't have to
naviagte the dataset record pointer to it within the context of the dataset
buffer.
In either case, you have to plug the value you are looking for in the
KeyFields array. If you don't know how to use the undocumented, internal
methods, I suppose this is the only place you can figure that out. Keep in
mind, I really prefer you just use the standard Locate() method but I'll
help as many as I can flex all the muscle possible in IBO.
Jason
> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> Behalf Of raoul.sitasoftware
> Sent: Wednesday, March 29, 2006 5:45 AM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] LookupKeyForFields vs. LookupKeyForBufferFields
>
>
> Hi!
>
> Could someone please explain the difference between
> 1)LookupKeyForFields and 2)LookupKeyForBufferFields from the
> TIB_BDataSet? I'm getting familiar with IBO and wondered what these
> are for.
> First, I thought 1) would do a Lookup only on server and 2) would do a
> Lookup on Buffer and, if not found in buffer, then on server. Now I
> don't understand anything because I won't get results with
> both of them.
>
> My simple use case: I use a TIB_Query, I set 2 KeyLinks, let's say ID1
> and ID2, as statement I use a SELECT * FROM. Before the Lookup I set
> the values for ID1 and ID2 in the KeyFields. After Lookup I get the
> desired value from the searched record with
> BufferFieldByName('FIELD').
> When I open the dataset before Lookup I get always the SAME record as
> result of my Lookup, when I don't open the dataset I get no results;-)
>
> What am I understanding or doing wrong?
>
> Thx for your help!
> Raoul