我试过用select * from data.db where UPPER(memo) like upper(:key)的方法,但好象upper并不支持memo形的字段,报错,有没有简单的方法让query控件不区别大小写查询啊?

解决方案 »

  1.   

    locate('fieldname','fieldvalue',[loCaseInsensitive, loPartialKey])
      

  2.   

    adotable 和   adoquery 一样
    Call Locate to search a dataset for a specific row and make it the current row.KeyFields is a string containing a semicolon-delimited list of field names on which to search.KeyValues is a variant that specifies the values to match in the key fields. If KeyFields lists a single field, KeyValues specifies the value for that field on the desired row. To specify multiple search values, pass a variant array as KeyValues, or construct a variant array on the fly using the VarArrayOf routine. For example:with ADOTable1 do
      Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '408-431-1000']), [loPartialKey]);
    TLocateOptions Opts;
    Opts.Clear();
    Opts << loPartialKey;
    Variant locvalues[2];
    locvalues[0] = Variant("Sight Diver");
    locvalues[1] = Variant("P");
    CustTable->Locate("Company;Contact", VarArrayOf(locvalues, 1), Opts);Options is a set that optionally specifies additional search latitude when searching on string fields. If Options contains the loCaseInsensitive setting, then Locate ignores case when matching fields. If Options contains the loPartialKey setting, then Locate allows partial-string matching on strings in KeyValues. If Options is an empty set, or if KeyFields does not include any string fields, Options is ignored.
      

  3.   

    可以用locate,具体使用参考DELPHI自带的帮助
      

  4.   

    用SQL语句不行吗?我希望得到所有符合条件的记录,而不是一条,就象全文检索一样