Subject Re: [IBO] Which is the best method?
Author Jason Wharton
If you are just refreshing with new input parameter values, Close the query,
set the parameter values and Open it again.

If you need to make adjustments to the WHERE or ORDER BY clause then you can
use the OnPrepareSQL event in conjunction with the InvalidateSQL method and
the SQLWhereItems property.

Calling Unprepare explicitly takes the query to a fully unprepared
(deallocated) state.

The answer is "a".

HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com

-- We may not have it all together --
-- But together we have it all --


----- Original Message -----
From: "Marco Menardi" <mmenaz@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, November 11, 2002 6:04 PM
Subject: [IBO] Which is the best method?


> What is the best method to minimize overhead by the server when I want
> to execute a ib_query again, but with new parameters (in BeforeOpen
> event) and new "where" criteria (in PrepareSQL)?
> I've tested that theese works (in the sense that PrepareSQL and
> BeforeOpen events are executed, and the right dataset is returned):
> (Second time here, so the query is still open)
> a) Close; InvalidateSQL
> b) Close; Unprepare;
> c) Unprepare;
> if Active then Refresh else Open
> which is better? a), b) or c)? Another one?
>
> Thanks
> Marco Menardi