Subject Re: [IBO] TIBOQuery modify Order affects Params
Author teamtlas
--- In IBObjects@yahoogroups.com, "Jaimy Azle" <jazle@s...> wrote:
> On Wednesday, October 29, 2003 10:38 AM teamtlas wrote:
>
> > The problem I am having is that since converting to IBO the first
> > "Open" of a query executes fine but after closing the query and
> > modifying the "ORDER BY" clause dynamically, the second "Open"
causes
> > parameter problems
>
> AFAIK, everytime you modify the query statement, you'll need to
reprepare
> it. What if:
>
> > with IBOQuery1 do
> > begin
> > close;
> + SQL[10] := 'ORDER BY O.ODESC ASC';
> + prepare;
> > Params[0].AsInteger := 0;
> > Params[1].AsInteger := 999999999;
> > Params[2].AsDateTime := Date;
> > Params[3].AsString := '';
> > Params[4].AsString := 'zzzzzzzzzzzzzzzzzzzz';
> > Params[5].AsInteger := 0;
> > Params[6].AsInteger := 999999999;
> > Params[7].AsString := 'B';
> > open;
> > close;
> + SQL[10] := 'ORDER BY O.ODESC DESC';
> + prepare;
> > Params[0].AsInteger := 0;
> > Params[1].AsInteger := 999999999;
> > Params[2].AsDateTime := Date;
> > Params[3].AsString := '';
> > Params[4].AsString := 'zzzzzzzzzzzzzzzzzzzz';
> > Params[5].AsInteger := 0;
> > Params[6].AsInteger := 999999999;
> > Params[7].AsString := 'B';
> > open;
> > end;

I wish the solution was that simple! If you try this, it crashes on
the *SECOND* prepare statement with previously mentioned date format
error.

Mark H (teamtlas)