ADOQuery的Filter问题!!!

zhyanger zhyanger 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
用ADOQuery的Filter过滤,有and 多条件
Filter内容如下:

if Edit.Text='所有' then
ADOQuery1.Filter:=' rq>='+''''+FormatDateTime('yyyy-mm-dd',DBDateTimeEditEh1.Value)+''''+' and rq<='+''''+FormatDateTime('yyyy-mm-dd',DBDateTimeEditEh2.Value)+''''+' and kfmc like '+''''+edit2.Text+'%'+''''
else
ADOQuery1.Filter:='lhid='+inttostr(lhid)+' and rq>='+''''+FormatDateTime('yyyy-mm-dd',DBDateTimeEditEh1.Value)+''''+' and rq<='+''''+FormatDateTime('yyyy-mm-dd',DBDateTimeEditEh2.Value)+''''+' and kfmc like '+''''+edit2.Text+'%'+'''';

程序在SQL MSSERVER 服务器端运行没有问题,可在客户端运行时,
就提示 "项目在所需的名称或序数中未被发现" 的错误。
为什么服务器端可以,客户端就有错,是我Filter写的有问题吗?

...全文
评论 11
收藏 已收藏
分享
返回顶部
zhyanger
数据库相关 2,508 成员 88,437 内容