ADOQuery的Filter问题!!!

zhyanger 2004-02-26 11:32:42
用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写的有问题吗?

...全文
246 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复

2,498

社区成员

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

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