Subject Re: [IBO] More Params info
Author Ryan Nilsson-Harding
Hi Geoff,

Thanks for your two detailed replies.
I appreciate everything you have told me, and I have changed the
OldParameterOrdering option, restarted server, but my problem still
persists.

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...

Here is the actual code:
Note that the IF statement checks to see if it is the same parameter
being used, and if so simply changes the value. This is OK.
It's the ELSE section that was working until today, and is now
causing AV's

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...

qry.Params[0].AsInteger := posHISTORY; <== AV caused here
{If I use ParamByName('rp_id'), I get an error stating there is no
such field 'rp_id'}

qry.Open;
qry.EnableControls;

Because the AV is happening before the query is sent to the server,
it never shows up in the monitor.

Thanks again for your advice, and any other suggestions you may have.
I'm sure this is something quite small..

Rgds,
-Ryan