Subject Re: [IBO] More Params info
Author Geoff Worboys
> Also, I don't think that what you have pointed out is
> relevant for me, because I only ever have one parameter,
> so I don't see how it could be getting confused with
> other params...

Agreed - mostly I was answering the query raised by what
Helen was saying.


> Here is the actual code:

Is this code happening from within another event, if so
what event?


> It's the ELSE section that was working until today, and
> is now causing AV's

What changed? Not meaning to state the obvious (well maybe
I am :-) but if it was working and now is not, then something
must have changed.


> if (currentView = vwCurrent) then
> qry.ParamByName('rp_id').AsInteger := posHISTORY;
> else begin
> qry.DisableControls;
> qry.SQLWhere.Clear;
> qry.SQLWhere.Add('WHERE Q.RP_ID = :rp_id');
> if not qryQuote.Prepared then
> qry.Prepare; <== This is never called...

This is what makes me think you are operating from within
another event, or something that is impacting where we are
upto in the processing. The statement should not be prepared
at this point - the SQL has been changed. Perhaps you should
try an explicit unprepare at the top of this block. Not sure
if SQLWhere is designed to be used while the statement is
currently prepared.

Oh, hang on thats:
if not ***qryQuote***.Prepared then
its not the same component! Now I am confused. Care to
explain?


--
Geoff Worboys
Telesis Computing