Adoquery1.locate()?这命令的格式怎么写呀? 如果我要找name='AAA'的记录。

解决方案 »

  1.   

    注意加入引用单元 DB
    locate('name',('AAA'),[])
      

  2.   

    Implements a virtual method for searching a dataset for a specified record and making it the active record.function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean; virtual;DescriptionThis function Checks whether the dataset is unidirectional, and if so, raises an EDatabaseError exception.
    Returns False, indicating that a matching record was not found and the active record was not changed.Descendant classes that are not unidirectional override this method so that it locates the record where the fields identified by the semicolon-separated list of fields in KeyFields have the values specified by the Variant or Variant array KeyValues. Options indicates whether the search is case insensitive and whether partial matches are supported. Locate returns True if a record is found that matches the specified criteria and that record is now active.
      

  3.   

    首先要把Db添加到uses里面,然后按下面办法:
    1、单个字段:
    table1.locate('FieldName','SearchText',[loCaseInsensitive, loPartialKey]);
    2、多个字段
    table1.locate('Field1;Field2;Field3','Text1;Text2;Text3',[loCaseInsensitive, loPartialKey]);
      

  4.   

    Locate('UserName',UserCB.Text,[loCaseInsensitive])提示错误:undeclared identifier:'loCaseInsensitive'请问各位专家这是为何?