德尔福 ADO 查询德尔福、ADO

2023-09-08 08:31:26 作者:原宿风i

有没有比遍历 ADO 数据集更快的方法

Is there any faster way to iterate through an ADO Dataset than

while (not ADOQuery1.Eof) do
    begin
      /* Do something */
      ADOQuery1.Next;
    end;

我需要扫描大约 9000 个项目的数据集,并且只提取与预定义的一组分支编号匹配的记录.

I need to scan a dataset of around 9000 items and only extract records matching a pre-defined set of branch numbers.

推荐答案

这样的任务使用 ADORecordset 会快很多:

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;