Subject Re: [IBO] Prepared and unprepared
Author Tim Ledgerwood
>Did you realise this is a completely unnecessary consumption of
>resources? If the only thing in your query that changes is the value of
>the parameter(s) then you only have to call Refresh. The query stays both
>active and prepared.

OK - if I understand you correctly, I could accomplish the same by doing
the following :

with MyQuery do
begin
//Leave out the "If Active" statement
ParamByName('XYZ').AsSomething := varXYZ;
if not prepared then prepare; //prepare if not prepared already
Open;
end;

With queries where the SQL changes, I could do the following :

with MyQuery do
begin
If Active then Close;
SQL := 'some SQL string';
ParamByName('XYZ').AsSomething := varXYZ;
if not prepared then prepare; //prepare if not prepared already
Open;
end;

Thanks a mill to all, btw.

(Its all my D1 and D2 with Sybase coming out ... :-))

Tim


[Non-text portions of this message have been removed]