参数不足,期待是 5的问题 在线等!
代码如下 各位看看有什么问题 rp是防sql诸如的函数
select1=rp(Request( "a "))
select2=rp(Request( "b "))
select3=rp(Request( "c "))
select4=rp(Request( "d "))
ans=rp(Request( "answer "))
ans=ucase(answer)
q=Request( "q ")
Set conn = Server.CreateObject( "ADODB.Connection ")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq= "& Server.MapPath( "db.mdb ")
sql= "update test set subject= ' "&q& " ',a= ' "&a& " ', b= ' "&b& " ', c= ' "&c& " ', d= ' "&d& " ', ans= ' "&answer& " ' where id= "&Request( "id ")
conn.execute (sql)
response.redirect "edit.asp?id= "&Request( "id ")
运行后的错误是
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] 参数不足,期待是 5。
/candy/save.asp, 第 23 行
------解决方案--------------------select1=rp(Request( "a "))
select2=rp(Request( "b "))
select3=rp(Request( "c "))
select4=rp(Request( "d "))
ans=rp(Request( "answer "))
ans=ucase(answer)
'要注意喽
q=Request( "q ")
Set conn = Server.CreateObject( "ADODB.Connection ")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq= "& Server.MapPath( "db.mdb ")
sql= "update test set subject= ' "&q& " ',a= ' "&a& " ', b= ' "&b& " ', c= ' "&c& " ', d= ' "&d& " ', ans= ' "&answer& " ' where id= "&Request( "id ")
'唉唉唉,这个answer是从哪里来的?而且不且answer,包括a呀,b,c,d等之类的全不知道从哪里来的?
conn.execute (sql)
response.redirect "edit.asp?id= "&Request( "id ")