sql语句不执行

magicjt007 2010-12-20 11:49:29
conn.execute("update research set select"&options&"=select"&options&"+1 where que_code="&quecode&" update dept set dept_sub=1 where dept_code="&session("dept_code"))
response.write ("<script>alert('投票成功');window.location='research.asp?que_code="&quecode&"';</script>")
为什么sql语句没执行,如果页面不跳转,也就是说不要window.location='research.asp?que_code="&quecode&"';就可以!
...全文
120 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lzp4881 2010-12-20
  • 打赏
  • 举报
回复
有些东西没必要是去深究为什么,电脑上的东西有很多东西是说不清楚的,你只要知道这样干行不通就可以了。
但是可能肯定的是,语句执不执行跟跳不跳转肯定没关系,你的问题应该在其它方面。
magicjt007 2010-12-20
  • 打赏
  • 举报
回复
数据库是SQL sever2000
lzp4881 2010-12-20
  • 打赏
  • 举报
回复
你数据库是ACCESS还是SQL如果是SQL是可以的,但如果是ACCESS,肯定是不行的。

所以为了保险起见,也为了代码的兼容性,还是分开写比较好。
magicjt007 2010-12-20
  • 打赏
  • 举报
回复
谢谢你,不过我还是要问下,如果不跳转写在一起是可以执行的呀!
lzp4881 2010-12-20
  • 打赏
  • 举报
回复
conn.execute("update research set select"&options&"=select"&options&"+1 where que_code="&quecode&" update dept set dept_sub=1 where dept_code="&session("dept_code"))
把这句拆开来,不要写在一起
conn.execute("update research set select"&options&"=select"&options&"+1 where que_code="&quecode)
conn.execute("update dept set dept_sub=1 where dept_code="&session("dept_code"))

28,391

社区成员

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

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