例如,
我要查找数据表中‘name’字段等于Edit1.text中的内容的。(注:数据源已连接好了),要不完全匹配的查找。
locate中的三个参数应该怎么写?

解决方案 »

  1.   

    adoquery1.locate('字段名','匹配内容',[]) 不懂有没有记错~
      

  2.   

    --原型 
    function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions)
    ----------------------------
    Adoquery1.Locate('name',Edit1.Text,[loPartialKey])
    --Locate第三个参数loCaseInsensitive Key fields and key values are matched without regard to case.
    loPartialKey Key values can include only part of the matching key field value; for example, 'HAM' would match both 'HAMM' and 'HAMMER.'
      

  3.   

    单值, dataset.locate(keyField1, val1,[loCaseInsensitive, loParticalKey]);多个值,dateset.locat(keyField1,keyField2..KeyFieldn, VarArrayof(val1,val2..valn),[loCaseInsensitive,loParticalkey] );