[CODE]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>成绩管理</title>
<script language="vbscript">
<!--
sub edit_onclick
fms.submit
end sub
sub del_onclick
fms.mark.value=""
fms.note.value=""
fms.submit
end sub
sub goback_onclick
window.history.back()
end sub
-->
</script>
</head>
<body>
<div align="center" class="STYLE1">课程成绩管理页</div>
<hr>
<form name="fms" method="get" action="mst01.asp">
<table width="480" border="0">
<tr>
<td colspan="3">
<div align="center">更新操作带*号为必填;删除操作不填写成绩</div>
</td>
</tr>
<tr>
<td width="126" height="30">
<div align="right">学生学号:</div>
</td>
<td width="215">
<input name="stid" type="text" size="20"> *</td>
<td width="117"> </td>
</tr>
<tr>
<td height="30">
<div align="right">课程编号:</div>
</td>
<td><input name="coid" type="text" size="20"> *</td>
<td> </td>
</tr>
<tr>
<td height="30"><div align="right">课程成绩:</div></td>
<td><input name="mark" type="text" size="20"> *</td>
<td> </td>
</tr>
<tr>
<td height="138" valign="top"><div align="right">备注信息:</div></td>
<td valign="top">
<textarea name="note" rows="10"></textarea>
</td>
<td> </td>
</tr>
<tr>
<td height="32" colspan="3" align="center" valign="middle">
<table width="200" border="0">
<tr>
<td width="84">
<input name="edit" type="button" id="edit" value="添加记录">
</td>
<td width="9"> </td>
<td width="85">
<input name="del" type="button" id="del" value="删除记录">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<%
dim stid,coid,mark,note,kmsg,ermsg
on error resume next
stid=request("stid")
coid=request("coid")
mark=request("mark")
note=request("note")
sub showerror(erinfo)
Response.Write("<font color=red>")
Response.Write(ermsg&"错误原因如下……")
Response.Write("</font>")
Response.Write("<input type=button value=返回修改 name=gaback>")
Response.Write("<p>"& erinfo)
end sub
if stid<>"" then
If mark<>"" Then
mysql="update sreport set mark="&mark&",[note]='"& note&"'"
mysql=mysql&" where stid='"& stid&"'and coid='"&coid&"'"
okmsg="当前记录已被成功更新!"
ermsg="更新操作出现错误!"
else
mysql="delete *from sreport "
mysql=mysql&" where stid='"& stid&"'"& "and coid='"& coid& "'"
okmsg="当前已被!"
ermsg="删除操作失败!"
end if
set objconn=session("objconn")'楼主确定写的是ASP代码?
'我目前还真没在ASP代码中看到过这种写法。
objconn.execute mysql,rdsaffected
if err.number>0 or objconn.errors.count>0 then
call showerror(err.number& ":"& err.description)
err.clear
obj.conn.errors.clear
else if rdsaffected=0 then
showerror("数据库中没有当前学生相关记录!")
else
Response.Write(okmsg)
end if
end if
end if'这里这个end if的if在哪里?
%>
</body>
</html>[/CODE]
[此贴子已经被作者于2007-8-16 19:38:23编辑过]