在数据集中,已包括了所有记录,我如何快速找到某一条记录?
即如何快速定位?我知道一个为数字型字段的值

解决方案 »

  1.   

    ADOTable1.Locate('id','10',[loCaseInsensitive])
      

  2.   

    ADOQuery1.Locate()
    ADOQuery1.Lookup()
      

  3.   

    ADOTable1.Locate('字段','你想要的值',[loPartialKey]);
    loCaseInsensitive 大小写是否敏感
    loPartialKey 部分匹配ADOQuery1.Lookup()// 这个是不行的,他不移动光标
      

  4.   

    Searches the dataset for a specified record and makes that record the current record.function Locate(const KeyFields: String; const KeyValues: Variant; Options: TLocateOptions): Boolean; override;
    ADOTable1.Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '408-431-1000']), [loPartialKey]);
      

  5.   

    ADOQuery1.Lookup()// 这个是不行的,他不移动光标 
    对头,只能找
    ADOTable1.Locate('字段','你想要的值',[loPartialKey]);定位