📄 gchang.asp
字号:
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<body leftmargin="150">
<table border="1" width="459" height="331">
<tr>
<td height="49" width="449" colspan="5">
<p align="center"><b><font size="6"> 学生成绩管理</font></b></td>
</tr>
<form action="gchang.asp" method="post">
<tr>
<td height="34" width="72">
<p align="right">学号:</td>
<td height="34" width="371" colspan="4">
<p align="center"><input type="text" name="T2" size="20">
<input type="submit" value="提交" name="B1"></td>
</tr>
</form>
<tr>
<td height="30" width="449" colspan="5">
<p align="center"><b>查询结果</b></td>
</tr>
<tr>
<%
if request.form("B1")="提交" then
stuno=request.form("T2")
if stuno="" then
response.write "请输入学号"
else
session("stuno")=stuno
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='"&stuno&"'"
sql1="select * from grade where sno='"&stuno&"'"
rs.open sql,conn
if rs.eof then
response.write "<td height='30' width='449' colspan='5'><p align='center'><b>学号不存在</b></td>"
else
rs1.open sql1,conn
%>
<td height="20" width="-6" align="center">
姓名</td>
<td height="20" width="166" align="center">
课程名称</td>
<td height="20" width="64" align="center">
成绩</td>
<td height="20" width="129" colspan="2" align="center">
操作</td>
</tr>
<%while not rs1.eof %>
<tr>
<td height="27" width="-6" align="center">
<%=rs(1)%>
</td>
<td height="27" width="166" align="center">
<%=rs1(0)
%>
</td>
<td height="27" width="64" align="center">
<%=rs1(2)%>
</td>
<td height="27" width="59" align="center">
<a href="gchangp.asp?courseno=<%=rs1(1)%>">修改</a></td>
<td height="27" width="64" align="center">
<a href="gdelete.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 + -