注册 登录
编程论坛 ASP技术论坛

向数据库插入语句出错!求助,在线等

witchwang 发布于 2008-08-28 21:33, 896 次点击
insert into buchong(nquestion, statement) values("&recordset2("nquestion")&","&request.form("textno"&recordset2("nquestion"))&")报错:语句未结束,请问如何修改?
8 回复
#2
multiple19022008-08-28 21:53
Insert Into Table1(UserID,UserName,Psw) Values (1000,'Bill Gates','123456')
#3
witchwang2008-08-28 21:57
格式,我对过了,还是说语句未结束
#4
witchwang2008-08-28 22:00
if  request.form("textno"&recordset2("nquestion"))<>"" thencnn.execute "insert into buchong(nquestion, statement)     values('"recordset2("nquestion")"','"&request.form("textno"&recordset2("nquestion"))&"')"
    
    end if
报错"语句未结束",这是把上一面的传递结果,插入buchong表中,nquestion是数字型,statement是备注型
请问高手,这怎么回事?
#5
witchwang2008-08-28 22:00
if  request.form("textno"&recordset2("nquestion"))<>"" then
cnn.execute "insert into buchong(nquestion, statement)     values('"recordset2("nquestion")"','"&request.form("textno"&recordset2("nquestion"))&"')"
     
    end if
#6
kinghog2008-09-22 09:37
晕,偶也在等待中怎么没有人回答呢?
#7
孤独冷雨2008-09-22 09:59
你这样试一下,把上一页面从表单中传过来的值保存在一个变量里.然后再用SQL语句插入!
#8
yms1232008-09-22 10:20
if  request.form("textno"&recordset2("nquestion"))<>"" then
    cnn.execute "insert into buchong(nquestion, statement) values('"recordset2("nquestion")"','"&request.form("textno"&recordset2("nquestion"))&"')"
end if
空格和回车有时是不可省略的
#9
lili06102008-09-22 10:31
楼上的应该是对的.再有错,报错内容和程序全帖出来
1