在线等待,SQL语句问题??

chinanetspy 2003-09-22 03:07:59
strSQL = " UPDATE mainclass_law SET "& "strMainClass='" &Request.Form("MainClass")&"',"&"WHERE mainclass_law.law_mainclass_id="&numRecordId

不知道为什么,总是抱错,
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]在关键字 'WHERE' 附近有语法错误。

请高手帮忙改改,多谢了
...全文
25 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
lgr0727 2003-09-22
  • 打赏
  • 举报
回复
用response.write strSQL 打印出来,
然后复制结果出来,粘贴到SQL里面调试看看能不能通过。
homeyang 2003-09-22
  • 打赏
  • 举报
回复
把response.write(strSQL)打印出来的句子贴出来看看
homeyang 2003-09-22
  • 打赏
  • 举报
回复
如果是字符型的话要加''

law_mainclass_id='"&numRecordId & "'"
chinanetspy 2003-09-22
  • 打赏
  • 举报
回复
numRecordId 是数字型啊
homeyang 2003-09-22
  • 打赏
  • 举报
回复
numRecordId是数字型还是字符型
junguo 2003-09-22
  • 打赏
  • 举报
回复
有引号不用空格也可以,你看看你的栏位名对不对吧!
yywxlb 2003-09-22
  • 打赏
  • 举报
回复
用response.write(strSQL)打印出来看看

可以在sql里面调试看看
chinanetspy 2003-09-22
  • 打赏
  • 举报
回复
晕啊,还是不对
xanewong111 2003-09-22
  • 打赏
  • 举报
回复
where前面要有空格的,你没加空格,粗心了吧,呵呵。
chinanetspy 2003-09-22
  • 打赏
  • 举报
回复
还是不对同样的错误
ttt2 2003-09-22
  • 打赏
  • 举报
回复
where 前少了个空格
mmcgzs 2003-09-22
  • 打赏
  • 举报
回复
同意
pp4u 2003-09-22
  • 打赏
  • 举报
回复
strSQL = " UPDATE mainclass_law SET strMainClass='" & Request.Form("MainClass")&"' WHERE mainclass_law.law_mainclass_id="&numRecordId
pp4u 2003-09-22
  • 打赏
  • 举报
回复
strSQL = " UPDATE mainclass_law SET strMainClass='" & Request.Form("MainClass")&"' WHERE mainclass_law.law_mainclass_id="&numRecordId

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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