求教各位大虾,如何使query控件不分大小写查询MEMO字段,在下查遍各大论坛,未果,100分奉上!

zhaoli 2006-06-24 03:59:52
我试过用select * from data.db where UPPER(memo) like upper(:key)的方法,但好象upper并不支持memo形的字段,报错,有没有简单的方法让query控件不区别大小写查询啊?
...全文
196 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhaoli 2006-06-30
  • 打赏
  • 举报
回复
用SQL语句不行吗?我希望得到所有符合条件的记录,而不是一条,就象全文检索一样
blueer 2006-06-28
  • 打赏
  • 举报
回复
用CAST转换成字符格式
wudi_1982 2006-06-28
  • 打赏
  • 举报
回复
可以用locate,具体使用参考DELPHI自带的帮助
Rubi 2006-06-28
  • 打赏
  • 举报
回复
yq3woaini
赞同
飞天揽月 2006-06-28
  • 打赏
  • 举报
回复
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.
飞天揽月 2006-06-28
  • 打赏
  • 举报
回复
locate('fieldname','fieldvalue',[loCaseInsensitive, loPartialKey])

2,496

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧