Subject | Re: [IBO] Difference 'tween Open & First (IB_Cursor) |
---|---|
Author | Ryan Nilsson-Harding |
Post date | 2002-10-15T22:49:46Z |
Thanks for your reply Geoff,
I'm not sure if I explained it well. Even though I have solved my
problem, I really want to understand what IBO is doing, so I will
try to make the circumstance clearer:
I have a IB_Cursor, which has a simple select statement, with one
param.
SELECT STK_ID FROM STOCK
WHERE PARTNUM = :pn
Before my main import routine, I prepare this query.
During my import routine, several tables need to use this query to
determine a particular STK_ID.
What I was doing was to close the query, set the new param value,
then call open.
I started getting ambiguous results (the cursor was returning the
same STK_ID, even though its param was different each time)
Once I changed the .Open's to .First's all was well.
Could it be that the cursor was 'remembering' it's last position,
even though I was closing then re-opening it?
Sorry if this is still vague, I just feel like I should understand
why Open gave me unexpected results, and first works.
Rgds,
-Ryan
I'm not sure if I explained it well. Even though I have solved my
problem, I really want to understand what IBO is doing, so I will
try to make the circumstance clearer:
I have a IB_Cursor, which has a simple select statement, with one
param.
SELECT STK_ID FROM STOCK
WHERE PARTNUM = :pn
Before my main import routine, I prepare this query.
During my import routine, several tables need to use this query to
determine a particular STK_ID.
What I was doing was to close the query, set the new param value,
then call open.
I started getting ambiguous results (the cursor was returning the
same STK_ID, even though its param was different each time)
Once I changed the .Open's to .First's all was well.
Could it be that the cursor was 'remembering' it's last position,
even though I was closing then re-opening it?
Sorry if this is still vague, I just feel like I should understand
why Open gave me unexpected results, and first works.
Rgds,
-Ryan
> I would have thought that the two operations should have been
> equivalent with the default configuration of TIB_Cursor (where the
> AutoFetchFirst property is true).
>
> However there may be issues in regard to the order in which events
> are activated - and so perhaps events dont happen in the order your
> code is expecting.
>
>
> --
> Geoff Worboys
> Telesis Computing