Subject RE: [IBO] TIBOQuery.Close changes ComponentCount?
Author Jason Wharton
You probably have an event being kicked off and some kind of recursive
execution branch.

Jason Wharton

-----Original Message-----
From: sgharp [mailto:steve@...]
Sent: Tuesday, July 20, 2004 9:29 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] TIBOQuery.Close changes ComponentCount?


Hi All,

I'm using the following code to close query objects.

procedure TfrmRepIngrTrace.CloseQueries;
Var
i : Integer;
Begin
for i := 0 to Pred(ComponentCount) do
Begin
if (Components[i] IS TIBOQuery) then
Begin
TIBOQuery(Components[i]).Close;
End;
End;
End;

When it gets to a specific query (the same on every time), it is
changing the ComponentCount from 388 to 376. It's consistent and
does it every time on the same TIBOQuery object when the Close
method is fired. Several other queries close as would be expected
prior to it hitting the errant query. After closing the query in
question, I get a list index out of bounds on a future attempt
because of the change in ComponentCount.

I've never seen anything like this. Any ideas?

Steve