Hi everyone,
I am getting this error message
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
But not sure why when there seems to be the right amount this is my code now.
sub Updatequestions ()
For each item in Request.Form()
select case left(request.form(item),1)
case ""
case "Submit"
case "Next"
case "q"
case request("physicianid")
case 1
arr = split(request.form(item),",")
for cnt = 0 to ubound(arr)
'response.Write arr(cnt) & "<br>"
res = res + cint(arr(cnt))
next
txtsql ="INSERT INTO answers (questionid,ID,value)"_
& "VALUES ('" & right(item,len(item) - instr( item,"." )) & ","_
& trim(request("id")) & ","_
& res & "')"
case 2
txtsql ="INSERT INTO answers (questionid,ID,value)"_
& "VALUES ('" & right(item,len(item) - instr( item,"." )) & ","_
& trim(request("id")) & ","_
& right(request.form(item), 2) & "')"
case 3
txtsql ="INSERT INTO answers (questionid,ID,value)"_
& "VALUES ('" & right(item,len(item) - instr( item,"." )) & ","_
& trim(request("id")) & ","_
& right(request.form(item), 2) & "')"
end select
conn.Execute txtsql
next
Session("physicianID") = Request.Form("PhysicianID")
Response.Redirect "physicianpreference.asp?ID=" & trim(session("PhysicianID"))
end sub
%>
</body>
<!--#include file="disconnect.asp" -->
</html>
Thanks
I am getting this error message
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
But not sure why when there seems to be the right amount this is my code now.
sub Updatequestions ()
For each item in Request.Form()
select case left(request.form(item),1)
case ""
case "Submit"
case "Next"
case "q"
case request("physicianid")
case 1
arr = split(request.form(item),",")
for cnt = 0 to ubound(arr)
'response.Write arr(cnt) & "<br>"
res = res + cint(arr(cnt))
next
txtsql ="INSERT INTO answers (questionid,ID,value)"_
& "VALUES ('" & right(item,len(item) - instr( item,"." )) & ","_
& trim(request("id")) & ","_
& res & "')"
case 2
txtsql ="INSERT INTO answers (questionid,ID,value)"_
& "VALUES ('" & right(item,len(item) - instr( item,"." )) & ","_
& trim(request("id")) & ","_
& right(request.form(item), 2) & "')"
case 3
txtsql ="INSERT INTO answers (questionid,ID,value)"_
& "VALUES ('" & right(item,len(item) - instr( item,"." )) & ","_
& trim(request("id")) & ","_
& right(request.form(item), 2) & "')"
end select
conn.Execute txtsql
next
Session("physicianID") = Request.Form("PhysicianID")
Response.Redirect "physicianpreference.asp?ID=" & trim(session("PhysicianID"))
end sub
%>
</body>
<!--#include file="disconnect.asp" -->
</html>
Thanks