Delphi ADO Query

ado, dataset, delphi

Solution

It is much faster to use ADORecordset for such tasks:

 while not ADOQuery1.Recordset.EOF do
  begin
    ADOQuery1.Recordset.MoveNext;
    // get value
    SomeVar := ADOQuery1.Recordset.Fields['FieldName'].Value;  
  end;

Problem

Is there any faster way to iterate through an ADO Dataset than ``` while (not ADOQuery1.Eof) do begin /* Do something */ ADOQuery1.Next; end; ``` I need to scan a dataset of around 9000 items and only extract records matching a pre-defined set of branch numbers.

Original source