各位ggjj帮忙看下,default.asp文件,怎么把问卷结果分类读入到数据库里啊?红色的代码是有问题的
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="config.asp" -->
<%
dim Q_ID()
dim a_ID()
dim a_TEXT()
dim Yes_No_TEXT()
dim t_last_aid()
dim only_text_Y_N()
dim a_text_o()
dim U_ID()
dim U_text()
dim U_Active()
Call OpenDB()
%>
<!--#include file="top.asp" -->
<%
sqlstr_1="SELECT Q_ID,Q_Title,Q_Sort,Q_Num1,Q_Num2,Q_Vote FROM Question where Q_Active=true order by Q_ID"
set rs=server.CreateObject("Adodb.recordset")
rs.Open sqlstr_1,Dbconn,1,1
If Not rs.EOF Then %>
<form action="" method="post" name="form1">
<table width="780" cellspacing="1" cellpadding="3" border="0" bgcolor="#CCCCCC" align="center">
<tr bgcolor="#F2F2F2"><td bgcolor="#F2F2F2" ><input type="radio" name="zhuanye" value="信息管理与信息系统">信息管理与信息系统
<input type="radio" name="zhuanye" value="计算机科学与技术">计算机科学与技术<input type="radio" name="zhuanye" value="计算机艺术设计">计算机艺术设计<input type="radio" name="zhuanye1" value="数字媒体">数字媒体</td></tr></table>
<%rs_count=rs.RecordCount
T_OK="ok_pass"
PollNum = Request.Cookies("t_poll")("s" & T_OK )
for j=0 to rs_count-1 step 1
N_Quest = rs("Q_Title")
redim Q_ID(rs_count)
Q_ID(j) = Cint(rs("Q_ID"))
sql = "SELECT A_ID,A_Answer,Q_Vote FROM Answer WHERE Q_ID=" & Q_ID(j)
Set ars = Server.CreateObject("ADODB.Recordset")
ars.Open sql, DBConn, 1, 1
C=ars.recordcount
ReDim A_Count(c)
i=65
p_total=0
Content1=""
S=rs("Q_Sort")
W=rs("Q_Num1")
H=rs("Q_Num2")
if S=1 then
input_sort="radio"
elseif S=2 or S=3 then
input_sort="checkbox"
end if
For N=0 to C-1
'A_Count(N)=ars("Q_Vote")
aID = ars("A_ID")
answer = ars("A_Answer")
Content1=Content1 & "<input type=""" & input_sort & """ name=""poll" & j & """ value=""" & aID & """>["& chr(i) & "] "
Content1=Content1 & answer & "<br>"
ars.MoveNext
i=i+1
Next
if S=3 then
Content1=Left(Content1,Len(Content1)-4)
Content1=Content1 & "<input class='input2' name='other" & j &"' type='text' size='" & W & "'>"
Content1=Content1 & "<input name='y_n_text" & j &"' type='hidden' value='1'>"
Content1=Content1 & "<input name='text_last_aid" & j &"' type='hidden' value='" & aID & "'><br>"
end if
if S=4 then
Content1="<textarea name='a_text" & j & "' cols='" & W & "' rows='" & H & "'></textarea>"
Content1=Content1 & "<input name='only_text" & j &"' type='hidden' value='1'><br>"
end if
ars.Close
Set ars = Nothing
%>
<table width="780" cellspacing="1" cellpadding="3" border="0" bgcolor="#CCCCCC" align="center">
<tr bgcolor="#F2F2F2">
<td bgcolor="#F2F2F2">
<img src=IMAGES/bullet.gif align=absmiddle> <font color="#000000"><b><%=j+1%>、<%=N_Quest%> </b></font> </td>
</tr>
<tr>
<td valign="top" bgcolor="#FFFFFF">
<%response.write Content1 %> <input type="hidden" name="Q_ID" value="<%=Q_ID(j)%>">
</td>
</tr>
</table>
<%rs.movenext
next%>
<table width="780" cellspacing="1" cellpadding="3" border="0" bgcolor="#CCCCCC" align="center">
<tr bgcolor="#F2F2F2">
<td height="2" valign="bottom" bgcolor="#F2F2F2">
<input name="rs_count" type="hidden" id="rs_count" value="<%=rs_count%>">
<input type="submit" name="submit" value=" 提 交 Input" >
<input type="reset" name="reset" value=" 重 置 Reset"></td>
</tr>
</table>
</form>
<%
End IF
rs.Close
Set rs=Nothing
%>
<!--#include file="foot.asp" -->
<%
If Request.ServerVariables("REQUEST_METHOD")="POST" Then
zhuanye=Request.form("zhuanye")
For N=0 to C-1
if s=1 then
pid=request.form("A_ID")
sql="select * from Answer where A_ID = " & pid
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if zhuanye = "信息管理与信息系统" then
rs("Q_vote")=rs("Q_vote")+1
end if
if zhuanye = "计算机科学与技术" then
rs("Q_vote1")=rs("Q_vote1")+1
end if
if zhuanye = "计算机艺术设计" then
rs("Q_vote2")=rs("Q_vote2")+1
end if
if zhuanye = "数字媒体" then
rs("Q_vote3")=rs("Q_vote3")+1
end if
rs.update
rs.close
set rs=nothing
end if
if s=2 then
pid=split((request("A_ID")),",")
for i=0 to UBound(pid)
sql="select * from answer where A_ID="&pid(i)
set rs1=server.createobject("adodb.recordset")
rs1.open sql,conn,1,1
if zhuanye = "信息管理与信息系统" then
rs1("Q_vote")=rs1("Q_vote")+1
end if
if zhuanye = "计算机科学与技术" then
rs1("Q_vote1")=rs1("Q_vote1")+1
end if
if zhuanye = "计算机艺术设计" then
rs1("Q_vote2")=rs1("Q_vote2")+1
end if
if zhuanye = "数字媒体" then
rs1("Q_vote3")=rs1("Q_vote3")+1
end if
next
end if
rs1.update
rs1.close
set rs1=nothing
next
end if
%>