Subject RES: [IBO] AssignSQLWithSearch don't accept parameters
Author Luiz
Hi,



I already have seen this problem and I guess I was posted this problem in
the list before.



I suspect there is a bug here.



I had to do all manually transfering all SQL between tib_query and tiboquery
in order to work well.



Regards,



Luiz



De: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] Em nome de
Arn
Enviada em: quinta-feira, 21 de janeiro de 2010 09:53
Para: IBObjects@yahoogroups.com
Assunto: Re: [IBO] AssignSQLWithSearch don't accept parameters





Helen Borrie ha scritto:
>
>
> At 09:48 PM 21/01/2010, you wrote:
>
> >Helen wrote:
> >
> >
> >Assuming you already have an IB_Connection, MyConnection, and a
> >TIB_Transaction, MyTransaction, with tiConcurrency isolation:
> >>
> >> var
> >> QIB: TIB_Query;
> >> QIBO: TIBOQuery;
> >> aValue: string; // or whatever it has to be
> >> begin
> >> try
> >> QIB := TIB_Query.Create(self);
> >> with QIB do
> >> begin
> >> IB_Connection := MyConnection;
> >> IB_Transaction := MyTransaction;
> >> SQL.Add ('SELECT * FROM TABLE1 WHERE FIELD1 = :P1');
> >> IB_Transaction.StartTransaction;
> >> Prepare;
> >> end;
> >> QIBO := TIBOQuery.Create(self);
> >> with QIBO do
> >> begin
> >> IB_Connection := MyConnection;
> >> IB_Transaction := MyTransaction;
> >> end;
> >>
> >> aValue := {whatever you are doing to get the param value};
>
> Insert a test to ensure that aValue is what it should be, not an empty
> string or a string with the wrong character case.
>
> >>
> >> QIB.ParamByName('P1').AsString := aValue;
>
> // Add this statement (sorry I missed it!)
> QIB.Open;
>

I already do this with design TIB_Query and TIBOQuery.
I have put a TIB_Query and a TIBOQuery on a form, set up right
properties and so on

All work ONLY if I have no parameters.

However thanks for You time...

Arn





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