读书人

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

发布时间: 2012-03-11 18:15:39 作者: rapoo

很郁闷的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 ")

读书人网 >ASP

热点推荐