28,391
社区成员
发帖
与我相关
我的任务
分享
<%
dim sum
name=request("name")
week=request("week")
number=request("number")
if week<>"" and name<>"" and number<>"" then
application("weeknum")=week
if application("weeknum")>application("max") then
application("max")=application("weeknum")
end if
set rs=Server.CreateObject("ADODB.Recordset")
sql="update kq set 第" & week & "周 = " & number & " where 姓名 = '" & name & "'"
rs.open sql,conn,2,1
认真学习一下记录集的相关概念
上述是更新语句,而非查询语句,如何能够返回你想要的记录集呢?
根据你的需求其实写一个简单的SQL语句就可以解决,没必要这么麻烦的
for i=1 to application("max")
sum = sum + rs(1)
next
sql="update kq set 总计 =" & sum & " where 姓名 = " & name
rs.open sql,conn,2,1
conn.close()
response.redirect("kqok.asp")
end if
%>