vb中的SQL语句运行时出错,高手解决一下!

caobingyi 2008-03-12 09:07:58
下面这句错(写在vb中)在哪里?
Set rs2 = rsSql2.RunSelectSQLUpdatable("select * from tblmpartcost right outer join tblpartcost on tblmpartcost.clientcode = tblpartcost.clientcode where clientcode = '" & Trim(Item.SubItems(1)) & "' order by partname")

...全文
91 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yidie 2008-03-13
  • 打赏
  • 举报
回复
添加条件与排序中字段的前缀则可

Set rs2 = rsSql2.RunSelectSQLUpdatable("select * from tblmpartcost right outer join tblpartcost on tblmpartcost.clientcode = tblpartcost.clientcode where tblpartcost.clientcode = '" & Trim(Item.SubItems(1)) & "' order by tblpartcost.partname")
caobingyi 2008-03-12
  • 打赏
  • 举报
回复
查询分析器里可以执行,我想可能我的格式写的不对,但是又不知道错在哪里?
错误:clientcode不识别
zuoxingyu 2008-03-12
  • 打赏
  • 举报
回复
提示什么信息?
你可以把你的SQL语句打印出来,到查询分析器里去执行,就很明白了

7,785

社区成员

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

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