只知道用table.first和tsble.next逐条查找,但如果知道中间一个数据的关键字,想从中间查找如何实现?还望各位大侠多多指教!!

解决方案 »

  1.   

    Searches the dataset for a specified record and makes that record the current record.Delphi syntax:function Locate(const KeyFields: String; const KeyValues: Variant; Options: TLocateOptions
    ): Boolean;Retrieves field values from a record that matches specified search values.Delphi syntax:function Lookup(const KeyFields: String; const KeyValues: Variant; const ResultFields: String): Variant;Searches for a record containing specified field values.Delphi syntax:function FindKey(const KeyValues: array of const): Boolean; virtual;Moves the cursor to the record that most closely matches a specified set of key values.Delphi syntax:procedure FindNearest(const KeyValues: array of const);