asp+access高分悬赏,大神请进

liuphan 2017-06-16 04:18:55
问题表现:成绩查询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
%>


...全文
246 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
什么都不能 2017-06-25
  • 打赏
  • 举报
回复
on error resume next 把这个注释掉
浪子回头8 2017-06-23
  • 打赏
  • 举报
回复
respons.write sql 打印出SQL语句就很好调试了
  • 打赏
  • 举报
回复
浏览器都是同一个吗?看下f12有无js报错信息。 浏览器的急速和兼容模式试一下
Go 旅城通票 2017-06-19
  • 打赏
  • 举报
回复
自己打印sql丢数据库里面执行看就清楚了

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧