当前位置: 代码迷 >> ASP >> 很郁闷的sql语句,帮忙看看报错原因,该如何解决
  详细解决方案

很郁闷的sql语句,帮忙看看报错原因,该如何解决

热度:109   发布时间:2012-03-11 18:15:39.0
很郁闷的sql语句,帮忙看看报错原因
语句如下:

conn.Execute   = "update   hb_info   set   hb_type= "&request.Form( "hb_type ")& ",hb_right= ' "&hbd_right& " ',hb_stat= ' "&hbd_stat& " '   where   id= "&request.Form( "hbid ")& " "

报错如下:

Microsoft   VBScript   编译器错误   错误   '800a0401 '  

语句未结束  

info.asp,行   675  

conn.Execute   = "update   hb_info   set   hb_type= "&request.Form( "hb_type ")& ",hb_right=( "&hbd_right& "),hb_stat=( "&hbd_stat& ")   where   id= "&request.Form( "hbid ")& " "
---------------------------------------------^


------解决方案--------------------
&和h不能写在一起,当中加个空格,写在一起表示16进制数,
conn.Execute "update hb_info set hb_type= " & request.Form( "hb_type ") & ",hb_right= ' " & hbd_right & " ',hb_stat= ' " & hbd_stat & " ' where id= " & request.Form( "hbid ")

------解决方案--------------------
conn.Execute "update hb_info set hb_type= " & request.Form( "hb_type ") & ",hb_right= " & hbd_right & ",hb_stat= " & hbd_stat & " where id= " & request.Form( "hbid ")
  相关解决方案