📄 addscorez.asp
字号:
<!--#include file ="connection.asp"-->
<%
lessonno=request.Form("lessonno")
xueqi=request.Form("xueqi")
i=request.Form("scount")
sqlstr="select * from 成绩 order by ID"
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open sqlstr,CN
'response.write sqlstr
'response.end
if rs1.eof then
scount=0
else
scount=rs1("ID")+1
end if
for j=0 to i-1
sname="studentno"&j
stuno=request.form(sname)
scoreno="score"&j
score=request.form(scoreno)
sqlstr="select * from 成绩 where studentno='" & stuno &"' and lessonno='" & lessonno &"'"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open sqlstr,CN
if rs.eof then
sqlstr="insert into 成绩 values("& scount &",'"
sqlstr=sqlstr & stuno & "','"
sqlstr=sqlstr & lessonno & "',"
sqlstr=sqlstr & score & ",'"
sqlstr=sqlstr & xueqi & "')"
else
sqlstr="update 成绩 set score=" & score &" where studentno='" & stuno &"' and lessonno='" & lessonno &"'"
end if
CN.execute sqlstr
scount=scount+1
next
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -