各位看看我这个查分的系统怎么总显示查询内容不对呢?
很简单的一个asp查分系统。。本人不太懂,特来请教。。。conn.asp内容如下
<%
'定义连接及打开连接为各程序共用
dim conn
dim connstr,db
on error resume next
'connstr="driver={SQL Server};User Id=exam;PASSWORD=cddir;Description=examination;SERVER=192.168.1.100;DATABASE=exam"
db="\data\2009gaokao.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.open connstr
%>
search.asp内容如下
<!--#include file=conn.asp -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>成绩查询结果</title>
<link href="images/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {
color: #000000;
font-weight: bold;
}
.STYLE2 {color: #003300}
.STYLE3 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
</head>
<body>
<%
dim zkzh2
dim name2
zkzh2 = Request("ksbh1")
name2 = Request("name1")
sql="select * from chengji where name='"&trim(name2)&"' and ksbh='"&trim(zkzh2)&"' "
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
IF rs.eof Then
response.Redirect("err.asp")
else
%>
<center><div>
<table width="650" height="200" border="0" cellpadding="1" cellspacing="1" bordercolor="#000000">
<tr>
<td height="50"><div align="center" class="STYLE3">
<%
Response.Write("2009年高考成绩查询结果")
%>
</div></td>
</tr>
<tr>
<td height="33"> <span class="STYLE1">准考证号:<%=rs ("ksbh")%></br>
考生姓名:
<% =rs ("name") %>
</br>
考生类别:
<% =rs ("leibie") %>
</span></td>
</tr>
<tr>
<td height="50"><span class="STYLE1">语文:</span>
<% =rs ("yuwen") %>
<span class="STYLE1">数学:</span>
<% =rs ("shuxue") %>
<span class="STYLE1">英语:</span>
<% =rs ("yingyu") %>
<span class="STYLE1">理基:</span>
<% =rs ("liji") %>
<span class="STYLE1">化学:</span> <%=rs ("huaxue") %>
<span class="STYLE1">生物:</span>
<% =rs ("shengwu") %>
<span class="STYLE1">总分:</span>
<% =rs ("zongfen") %></td>
</tr>
<tr>
<td height="50"> <span class="STYLE1">过分数线:</span>
<% =rs ("gaokao") %></td>
</tr>
</table>
<p class="STYLE2">
<%
end if
rs.close
set rs=nothing
%>
</p>
<p class="STYLE2">谢谢使用,北京师范大学石竹附属学校 信息中心:王永闯 为你提供查询!</p>
</div>
</center>
</body>
</html>
谢谢了。。