问题表现:成绩查询asp+access配置在iis5.1下后台数据导入,查询正常,配置到32位sever12下面iis8下,后台数据导入正常,但查询不显示结果,也没有任何错误显示,请问问题从哪个方面着手解决。
下图在iis5.1下调试结果:
下图在iis8下调试结果:
数据库链接代码:
查询代码:
<!--#include file="dataconn.asp"-->
<%
xh=trim(request.querystring("xh"))
response.write xh
stuname=trim(request.querystring("stuname"))
team=trim(request.querystring("team"))
set rs=conn.execute("select cxsetup from cominfo")
cxsetup=rs("cxsetup").value
rs.close
set rs=nothing
if team="all" then
sql="select * from studentpmb where stuidh='"&xh&"' and stuname='"&stuname&"'"
team="本学年所有考试"
else
sql="select * from studentpmb where stuidh='"&xh&"' and stuname='"&stuname&"' and ksname='"&team&"'"
end if
on error resume next
set rs=conn.execute(sql)
if err then
response.write escape("对不起,还没有该次考试成绩或还没有导入成绩!")
response.end
end if
totalput=rs.RecordCount
if rs.eOF then
Response.Write escape("<font color=#ff0000>对不起,没有查询到该学生成绩记录,请检查你输入的学号和姓名是否对应!</font>")
response.end
end if
if team="本学年所有考试" then
response.write escape("<TABLE height=20 cellSpacing=0 cellPadding=0 width=90% align=center border=0><TBODY><TR><TD width=117> 班级: <FONT color=green>"&rs("nj")&rs("bj")&"</FONT></TD>")
response.write escape("<TD width=174>学号:<FONT color=green>"&xh&"</FONT</TD><TD width=191>姓名: <FONT color=green>"&stuname&"</FONT></TD>")
response.write escape("<TD width=278> </TD></TR></TBODY></TABLE>")
response.write escape("<TABLE height=20 cellSpacing=0 cellPadding=0 width=95% align=center border=0>")
response.write escape("<TBODY><TR><TD vAlign=center> "&team&"成绩列表</TD>")
response.write escape("<TD width=60> </TD></TR></TBODY></TABLE>")
set rssubject=conn.execute("select testname from testmdb,term,studentpmb where studentpmb.ksname=testmdb.testname and studentpmb.stuidh='"&xh&"' and term.tname=testmdb.term and term.tnow=1")
do while not rssubject.eof
testname=rssubject("testname").value
response.write escape("<TABLE height=20 cellSpacing=0 cellPadding=0 width=90% align=center border=0><TBODY><TR><TD> <font color=green><strong>考试名称:"&testname&"</strong></font></TD></TR></TBODY></TABLE>")
response.write escape("<TABLE style=""BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #cccccc 1px solid; COLOR: #444444; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eff4ff"" ")
response.write escape("cellSpacing=1 borderColorDark=#ffffff cellPadding=0 width=90% align=center borderColorLight=#ffffff border=0>")
response.write escape(" <TBODY><TR>")
set rs1=conn.execute("select subjectname from subjectks where testname='"&testname&"'")
strsubject=""
do while not rs1.eof
subject=rs1("subjectname")
strsubject=strsubject&subject&","
rs1.movenext
loop
set rs1=nothing
strsubject=left(strsubject,len(strsubject)-1)
Dimstrsubject=split(strsubject,",")
kms=ubound(dimstrsubject)
subjectt=""
for i=0 to kms
strsubject=Dimstrsubject(i)
subjectt=subjectt&"<TD><div align=""center""><strong><font color=#000000>"&strsubject&"</font></strong></div></TD>"
if cxsetup="1" then
subjectt=subjectt&"<TD><div align=""center""><strong><font color=#cccccc>班名</font></strong></div></TD><TD><div align=""center""><strong><font color=#cccccc>级名</font></strong></div></TD>"
end if
next
response.write escape(subjectt)
response.write escape("<TD ><div align=center class=STYLE2>总分</div></TD>")
if cxsetup="1" or cxsetup="2" then
response.write escape("<TD><div align=center class=STYLE2>班名</div></TD>")
response.write escape("<TD><div align=center class=STYLE2>级名</div></TD></TR>")
end if
set rs=conn.execute("select * from studentpmb where stuidh='"&xh&"' and stuname='"&stuname&"' and ksname='"&testname&"'")
do while not rs.eof
subjectname=""
for i=0 to kms
strsubject=dimstrsubject(i)
subjectname=subjectname&"<TD height=22><div align=""center""><strong><font color=#000000>"&rs(strsubject)&"</font></strong></div></TD>"
if cxsetup="1" then
subjectname=subjectname&"<TD><div align=""center""><strong><font color=#cccccc>"&rs(strsubject&"bm")&"</font></strong></div></TD><TD><div align=""center""><strong><font color=#cccccc>"&rs(strsubject&"nm")&"</font></strong></div></TD>"
end if
next
response.write escape("<TR bgColor=#ffffff>")
response.write escape(subjectname)
response.write escape("<TD height=22><div align=center><strong><font color=#cc0000>"&rs("zf")&"</font></strong></div></TD>")
if cxsetup="1" or cxsetup="2" then
response.write escape("<TD height=22><div align=center><strong><font color=#cc0000>"&rs("bjpm")&"</font></strong></div></TD>")
response.write escape("<TD height=22><div align=center><strong><font color=#cc0000>"&rs("njpm")&"</font></strong></div></TD>")
end if
rs.movenext
loop
response.write escape("</TD></TR></TBODY></TABLE>")
rssubject.movenext
loop
set rssubject=nothing
else
response.write escape("<TABLE height=20 cellSpacing=0 cellPadding=0 width=90% align=center border=0><TBODY><TR><TD width=117> 班级: <FONT color=green>"&rs("nj")&rs("bj")&"</FONT></TD>")
response.write escape("<TD width=174>学号:<FONT color=green>"&xh&"</FONT</TD><TD width=191>姓名: <FONT color=green>"&stuname&"</FONT></TD>")
response.write escape("<TD width=278> </TD></TR></TBODY></TABLE>")
response.write escape("<TABLE height=20 cellSpacing=0 cellPadding=0 width=90% align=center border=0><TBODY><TR><TD> <font color=green><strong>考试名称:"&team&"</strong></font></TD></TR></TBODY></TABLE>")
response.write escape("<TABLE style=""BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #cccccc 1px solid; COLOR: #444444; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eff4ff"" ")
response.write escape("cellSpacing=1 borderColorDark=#ffffff cellPadding=0 width=90% align=center borderColorLight=#ffffff border=0>")
response.write escape(" <TBODY><TR>")
set rs1=conn.execute("select subjectname from subjectks where testname='"&team&"'")
strsubject=""
do while not rs1.eof
subject=rs1("subjectname")
strsubject=strsubject&subject&","
rs1.movenext
loop
set rs1=nothing
strsubject=left(strsubject,len(strsubject)-1)
Dimstrsubject=split(strsubject,",")
kms=ubound(dimstrsubject)
for i=0 to kms
strsubject=Dimstrsubject(i)
subjectt=subjectt&"<TD><div align=""center""><strong><font color=#000000>"&strsubject&"</font></strong></div></TD>"
if cxsetup="1" then
subjectt=subjectt&"<TD><div align=""center""><strong><font color=#cccccc>班名</font></strong></div></TD><TD><div align=""center""><strong><font color=#cccccc>级名</font></strong></div></TD>"
end if
next
response.write escape(subjectt)
response.write escape("<TD ><div align=center class=STYLE2>总分</div></TD>")
if cxsetup="1" or cxsetup="2" then
response.write escape("<TD><div align=center class=STYLE2>班名</div></TD>")
response.write escape("<TD><div align=center class=STYLE2>级名</div></TD></TR>")
end if
do while not rs.eof
subjectname=""
for i=0 to kms
strsubject=dimstrsubject(i)
subjectname=subjectname&"<TD height=22><div align=""center""><strong><font color=#000000>"&rs(strsubject)&"</font></strong></div></TD>"
if cxsetup="1" then
subjectname=subjectname&"<TD><div align=""center""><strong><font color=#cccccc>"&rs(strsubject&"bm")&"</font></strong></div></TD><TD><div align=""center""><strong><font color=#cccccc>"&rs(strsubject&"nm")&"</font></strong></div></TD>"
end if
next
response.write escape("<TR bgColor=#ffffff>")
response.write escape(subjectname)
response.write escape("<TD height=22><div align=center><strong><font color=#cc0000>"&rs("zf")&"</font></strong></div></TD>")
if cxsetup="1" or cxsetup="2" then
response.write escape("<TD height=22><div align=center><strong><font color=#cc0000>"&rs("bjpm")&"</font></strong></div></TD>")
response.write escape("<TD height=22><div align=center><strong><font color=#cc0000>"&rs("njpm")&"</font></strong></div></TD>")
end if
rs.movenext
loop
response.write escape("</TD></TR></TBODY></TABLE>")
end if
rs.close
set rs=nothing
set rs1=nothing
conn.close
set conn=nothing
%>