📄 score_inputmodify_result.asp
字号:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%
var StudentId;
var Num;
var ProRs;
var TableRs;
var TableNameRs;
var TableName;
var ProName;
var CmdText;
var i;
StudentId=Request.Form("studentid");
Num=Request.Form("num");
ProRs=Server.CreateObject("ADODB.Recordset");
ProRs.ActiveConnection=Conn;
ProRs.CursorLocation=3;
ProRs.Source="SELECT 所学专业 FROM StudentInf WHERE 学籍号='"+StudentId+"'";
ProRs.Open();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>学生成绩输入修改结果</title>
<!--#include file="link.asp"-->
</head>
<body>
<!--#include file="top.asp"-->
<%
if(!ProRs.EOF)
{
ProName=ProRs(0).Value;
TableRs=Server.CreateObject("ADODB.Recordset");
TableRs.ActiveConnection=Conn;
TableRs.CursorLocation=3;
TableRs.Source="SELECT 成绩表名 FROM profession WHERE 所学专业='"+ProName+"'";
TableRs.Open();
if(!TableRs.EOF)
{
TableName=TableRs(0).Value;
TableNameRs=Server.CreateObject("ADODB.Recordset");
TableNameRs.ActiveConnection=Conn;
TableNameRs.CursorLocation=3;
TableNameRs.Source="SELECT * FROM "+TableName+" WHERE 学籍号='"+StudentId+"'";
TableNameRs.Open();
if(!TableNameRs.EOF)
{
CmdText="UPDATE "+TableName+" SET ";
for(i=1;i<=Num-1;i++)
{
CmdText=CmdText+TableNameRs.Fields(i).Name+"='"+Request.Form(i+2)+"',";
}
CmdText=CmdText+TableNameRs.Fields(i).Name+"="+Request.Form(i+2)+" WHERE 学籍号='"+StudentId+"'";
Conn.Execute(CmdText,0,0);
if(Conn.Errors.Count>0)
{
Response.Write("<div align=center><font size='6' color='#ff0000'>系统发生"+Conn.Errors.Count+"个错误!</font></div>");
}
else
{
Response.Write("<div align=center><font size='6' color='#ff0000'>该学籍号学生成绩已添加到该系成绩表中!</font></div>");
}
}
if(TableNameRs.EOF)
{
Response.Write("<div align=center><font size='6' color='#ff0000'>数据库错误,专业成绩表中无法找到该生成绩!</font></div>");
}
}
if(TableRs.EOF)
{
Response.Write("<div align=center><font size='6' color='#ff0000'>数据库错误,未添加该专业成绩表!</font></div>");
}
TableNameRs.Close();
TableNameRs=null;
TableRs.Close();
TableRs=null;
}
else
{
Response.Write("<div align=center><font size='6' color='#ff0000'>数据库错误,该学生专业未添加,请与管理员联系!</font></div>");
}
ProRs.Close();
ProRs=null;
Conn.Close();
Conn=null;
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -