adodc的recordsource问题

overcomeself 2004-09-28 01:00:48
fieldname="pid" 其中pid表示字段名
cmmark.text="<>"
下面有什么错误?
adodc1.recordsource="select * from products" + "where + & fieldstr1 &" + "+trim(cmbmark.text)+" + Trim(Txtcontent.Text)
adodc1.refresh
...全文
232 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
longki 2004-09-28
  • 打赏
  • 举报
回复
adodc1.recordsource="select * from products where " & fieldname & Trim(cmbmark.text) & Trim(Txtcontent.Text),就这样!
RUKYO 2004-09-28
  • 打赏
  • 举报
回复
adodc1.recordsource="select * from products" + "where + & fieldstr1 &" + "+trim(cmbmark.text)+" + Trim(Txtcontent.Text)
==========
adodc1.recordsource="select * from products where " & fieldname & Trim(cmbmark.text) & Trim(Txtcontent.Text)
overcomeself 2004-09-28
  • 打赏
  • 举报
回复
晕死,我没有在where后面空格.
谢谢saga007,谢谢上面的所有朋友。
paducn 2004-09-28
  • 打赏
  • 举报
回复
结贴了吧
paducn 2004-09-28
  • 打赏
  • 举报
回复
adodc1.recordsource="select * from products where " & fieldname & Trim(cmbmark.text) & "'" & Trim(Txtcontent.Text) & "'"

这个可以的了
我想你的 Trim(Txtcontent.Text) 不会是数值类型吧

sunmoonn 2004-09-28
  • 打赏
  • 举报
回复
adodc1.recordsource="select * from products where " & fieldname & Trim(cmbmark.text) & Trim(Txtcontent.Text)

bladeinside 2004-09-28
  • 打赏
  • 举报
回复
上面的还不行吗?
overcomeself 2004-09-28
  • 打赏
  • 举报
回复
上面的也不行,
说明一下,上面的fieldname并不是一个固定的字段。
chelseawu 2004-09-28
  • 打赏
  • 举报
回复
adodc1.recordsource="select * from products where " & fieldname & Trim(cmbmark.text) & Trim(Txtcontent.Text)

1,217

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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