asp 操作符丢失?

来源:百度知道 编辑:UC知道 时间:2024/06/30 16:09:26
代码如下::

'添加记录
if curaction = "newsave" then
if trim(request("txttitle")) = "" then
founderr = true
errmsg = "<p>请输入设备规格型号!</p>"
end if
if founderr then
response.write errmsg
else
sql = "INSERT INTO news(title,cateid,topicid,chejian,link,addtime,image,typeid,special,content,hits) VALUES('"
sql = sql + htmlencode(request("txttitle")) + "',"
sql = sql + request("selcate") + ","
sql = sql + request("seltopic") + ",'"
sql = sql + htmlencode(request("txtchejian")) + "',"
sql = sql + htmlencode(request("txtlink")) + "',"
sql = sql + request("txtaddtime") + ",'"
sql = sql + htmlencode(request("txtimage")) + "',"
sql = sql + request("selty

是不是你的sql有问题?

conn.execute sql之前加上两句:
response.write sql
response.end

然后把输出的sql放到数据库里执行一下,试试

'楼主有个严重的错误 您现在的环境应该是vbscript的吧,所以字符串连接应该要用 & 的

sql = sql & "title='" & htmlencode(request("txttitle")) & "',"

'改好了再试下哦,有问题再贴出来哦