Subject IBO_Query, stalling on row fetch
Author Peter Chaisty
Hi

I have been having some prpblems very rarely for a time with a
dialogue box appearing saying


Fetching Query Results
row #10

and an ABort button


The Ibo_query is a simple read only query simply fetching rows of
interest.

The code that is causing the problem is below, the exception is
firing and I have also managed to get screen shots at the same time
hence the row fetch dialogue box.

I know I could write this in a stored procedure , but I would also
like to know what I am doing wrongly in the code below.

Any help would be appreciated as I can't actually replicate the
problem on my pc.

Rgds

Peter



{!! Check stock levels in pins database
setting re-order flag as true is a
re-order is required
!!}
procedure TOdin_Server.CheckStockLevels;
begin
Re_Order := False;
// scan through table
if (IB_Connection1.Connected) then
begin
try
With IB_StockQuery do
begin
Refresh;
First;
While (Not(IB_StockQuery.Eof)) do
begin
If (FieldByName('STOCK_ON_HAND').asinteger < FieldByName
('LOW_WATERMARK').asinteger)
then Re_Order := True;
Next;
end;
end;
except
writelog('Error in check stock levels function',0);
end;
end
else writelog('Restock Not carried out db not connected',0);