斑竹能不能帮我改一下。。。
<html>
<head>
<title>学生成绩查询</title></head>
<body>
<%sid=trim(request("id"))
sname=trim(request("name"))
smin=trim(request("min"))
smax=trim(request("max"))
first="false"
condition="where"
if sid<>"" then
if first="true" then
condition=condition & "AND"
end if
condition=condition &"学号=" &sid
first="true"
end if
if sname="" then
if first="true" then
condition=condition & "AND"
end if
condition=condition &"姓名=" & sname
first="true"
end if
if smin<>"" then
if first="true" then
condition=condition & "AND"
end if
condition=condition & "(大学英语+高等数学+普通化学+大学物理+网页设计)/5>=" & smin
first="true"
end if
if smax<>"" then
if first="true" then
condition=condition & "AND"
end if
condition=condition & "(大学英语+高等数学+普通化学+大学物理+网页设计)/5<=" & smax
first="true"
end if
if first="true" then
SQLSTR="select * from 学生成绩" &condition
else
SQLSTR="select * from 学生成绩"
end if
Response.Write(SQLSTR)
dim id(99),name(99),english(99),math(99),chemistry(99),physics(99),asp(99),average(99)
set conn=server.CreateObject("ADODB.connection")
connstr="driver={sql server};server=0C2807CF47F6442;uid=sa;pwd=;database=internet"
conn.open connstr
set recordset=conn.execute("select * from 学生成绩")
%>
<%
number=0
do while(not recordset.eof)
id(number)=recordset("学号")
name(number)=recordset("姓名")
english(number)=recordset("大学英语")
math(number)=recordset("高等数学")
chemistry(number)=recordset("普通化学")
physics(number)=recordset("大学物理")
asp(number)=recordset("网页设计")
recordset.movenext
number=number+1
loop
conn.close
set recordset=nothing
set conn=nothing
%>
<p align="center"><font face="黑体" size="6">学生成绩表</font></p>
<table border="1" width="100%">
<tr>
<td width="12%" align="center" bgcolor="#CC0066">学号</td>
<td width="12%" align="center" bgcolor="#CC0066">姓名</td>
<td width="12%" align="center" bgcolor="#CC0066">大学英语</td>
<td width="12%" align="center" bgcolor="#CC0066">高等数学</td>
<td width="13%" align="center" bgcolor="#CC0066">普通化学</td>
<td width="13%" align="center" bgcolor="#CC0066">大学物理</td>
<td width="13%" align="center" bgcolor="#CC0066">网页设计</td>
<td width="13%" align="center" bgcolor="#CC0066">平均成绩</td>
</tr>
<% for i=0 to number-1
average(i)=(english(i)+math(i)+chemistry(i)+physics(i)+asp(i))/5
%>
<tr>
<td width="12%" align="center"><%=id(i) %></td>
<td width="12%" align="center"><%=name(i) %></td>
<td width="12%" align="center"><%=english(i) %></td>
<td width="12%" align="center"><%=math(i) %></td>
<td width="13%" align="center"><%=chemistry(i) %></td>
<td width="13%" align="center"><%=physics(i) %></td>
<td width="13%" align="center"><%=asp(i) %></td>
<td width="13%" align="center"><%=average(i) %></td>
</tr>
<%
next
%>
</table>
</body>
</html>