Subject RE: [IBO] IBOQuery stubborn about remembering fields
Author Jason Wharton
Send a sample app to me which shows the problem and I will take a look at
it.

Jason Wharton


> -----Original Message-----
> From: Hans Hoogstraat [mailto:hhoogstraat@...]
> Sent: Wednesday, November 10, 2004 6:29 PM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] IBOQuery stubborn about remembering fields
>
> Maybe this problem has been resolved in 4.5
>
> But
>
> with IBOQuery do
> begin
> close;
> SQL.Clear;
> SQL.Add(Select * from TableOne);
> SQL.Prepare;
> open;
>
> close;
> SQL.Clear;
> SQL.Add(Select * from TableTwo);
> SQL.Prepare;
> open;
>
> If TableTwo has different Field\Names than TableOne, I get errors on
> FieldNames not found from TableOne. Tried everything to force
> some kind of
> clear internal FieldNames.
> But I did get it to work by inserting a dummy ExecSQL like.
> The IBOQuery is
> never populated via a right click -> add all fields
>
> with IBOQuery do
> begin
> close;
> SQL.Clear;
> SQL.Add(Select * from TableOne);
> SQL.Prepare;
> open;
>
> close;
> SQL.Clear
> SQL.Add('Commit');
> ExecSQL;
>
> close
> SQL.Clear;
> SQL.Add(Select * from TableTwo);
> SQL.Prepare;
> open;
>
> With the addinal ExecSQL, the internal fieldnames obtained
> from TableOne
> seem to be cleared at the time TableTwo is queried and no
> error occur.