📄 testchang.asp
字号:
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>test chang</title>
</head>
<body leftmargin="150">
<table border="1" width="478" height="393">
<tr>
<td height="81" width="468" colspan="6">
<p align="center"><b><font size="7">学生考试管理</font></b></td>
</tr>
<form action="testchang.asp" method="post">
<tr>
<td height="52" width="154" colspan="2">
<p align="right">学号:</td>
<td height="52" width="308" colspan="4"><input type="text" name="T2" size="20">
<input type="submit" value="提交" name="B1"></td>
</tr>
</form>
<tr>
<td height="28" width="468" colspan="6">
<p align="center"><b>查询结果</b></td>
</tr>
<tr>
<%
if request.form("B1")="提交" then
studno=request.form("T2")
if studno="" then
response.write "请输入学号"
else
session("studno")=studno
dim conn,connstr
connstr="Driver={sql server};UID=sa;PWD=sa;database=zikao;server=BILLGATES"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
set rs=Server.CreateObject("ADODB.Recordset")
set rs1=Server.CreateObject("ADODB.Recordset")
sql="select * from register where sno='"&studno&"'"
sql1="select * from grade where sno='"&studno&"'"
rs.open sql,conn
if rs.eof then
response.write "<td height='28' width='468' colspan='6'><p align='center'>学号不存在</td>"
else
rs1.open sql1,conn
%>
<td height="24" width="71">
<p align="center">姓名</td>
<td height="24" width="77">
课程编号</td>
<td height="24" width="123">
<p align="center">课程名称</td>
<td height="24" width="81">
<p align="center">考试时间</td>
<td height="24" width="92" colspan="2">
<p align="center">操作</td>
</tr>
<% while not rs1.eof%>
<tr>
<td height="27" width="71">
<%=rs(1)%></td>
<td height="27" width="77">
<%=rs1(1)%></td>
<td height="27" width="123">
<%=rs1(0)%></td>
<td height="27" width="81">
<%=rs1(3)%></td>
<td height="27" width="36">
<p align="center"><a href="testchangp.asp?courseno=<%=rs1(1)%>">修改</a></td>
<td height="27" width="50">
<p align="center"><a href="testdelete.asp?courseno=<%=rs1(1)%>">删除</a></td>
</tr>
<%
rs1.MoveNext()
wend
end if
end if
end if
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -