Subject Re: [IBO] TIBOQuery.Close changes ComponentCount?
Author Hans Hoogstraat
Try

for i := Pred(ComponentCount) downto 0 do
Begin
....

----- Original Message -----
From: "sgharp" <steve@...>
To: <IBObjects@yahoogroups.com>
Sent: Tuesday, July 20, 2004 10:28 AM
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
|
|
|
|
|
___________________________________________________________________________
| IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
| without the need for BDE, ODBC or any other layer.
|
___________________________________________________________________________
| http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
| keyword-searchable FAQ, community code contributions and more !
| Yahoo! Groups Links
|
|
|
|
|