为什么总是提示找不到参数?

mark2003 2006-11-28 06:09:28
为什么总是提示找不到参数chiNam,是不是我的格式错了?

container->ADOQuery2->Close();
container->ADOQuery2->SQL->Clear();
container->ADOQuery2->SQL->Add("select * from reserveRestDays where theMonth=:monthValue and chiNam like'%:chiNam%'");
container->ADOQuery2->Parameters->ParamByName("monthValue")->Value=monthValue;
container->ADOQuery2->Parameters->ParamByName("chiNam")->Value=chiNam;
container->ADOQuery2->Open();
...全文
231 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
柯本 2006-11-28
  • 打赏
  • 举报
回复
参数不要写在''中,这样可以:
...
container->ADOQuery2->SQL->Add("select * from reserveRestDays where theMonth=:monthValue and chiNam like :chiNam ");
...
container->ADOQuery2->Parameters->ParamByName("chiNam")->Value=String("%")+chiNam+"%";

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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