Name=request("Name")
StudentID=request("StudentID")
%>
flag=false
rs.Open "Select * From 成绩表 where StudentID='"& StudentID &"'", conn,3,2
while not rs.eof
'response.write rs("试卷名称")
if rs("试卷名称")= Subject then
flag=true
end if
rs.movenext
wend
'response.write flag
rs.close%>
msgbox"该记录已写入数据库!"
location.href="vbscript:window.close()"
rs.Open "Select * From 成绩表 where StudentID='"& StudentID &"'", conn,3,2
'response.write Subject
rs.addnew
rs("Name")=name
rs("StudentID")=StudentID
rs("考试时间")=now()
rs("成绩")=0
rs("试卷名称")=Subject
rs.update
rs.close
end if
%>
你已经成功退出!
此次操作,系统即认为你要交白卷,且你已无资格再次参加这门课的考试!