日期:2014-05-16 浏览次数:20952 次
sql1="select * from ems_dbxx"
Set rs1=Server.CreateObject("ADODB.RecordSet")
rs1.Open sql1,Conn,1,2
if rs1.eof and rs1.bof then
response.write"<script>alert('错误!');</script>"
else
while not(rs1.eof)
for i=1 to 12
Conn.Execute("update ems_dbxx set dbxx_lastmonth='"&i&"' where dbxx_m"&i&" is not null")
next
rs1.movenext
wend
end if
response.Write"<script>alert('时间更新成功!');window.location='dbxx_edit.asp';//</script>"
<%
dim n
sql1="select * from ems_dbxx"
Set rs1=Server.CreateObject("ADODB.RecordSet")
rs1.Open sql1,Conn,1,3
if rs1.eof and rs1.bof then
response.write"<script>alert('错误!');</script>"
else
while not(rs1.eof)
n=""
for i=1 to 12
if rs1("dbxx_m"&i)<>null then n=i
next
if n<>"" then
rs1("dbxx_lastmonth")=n
rs1.update
end if
rs1.movenext
wend
end if
Rs1.Close:Set Rs1=Nothing
response.Write"<script>alert('时间更新成功!');window.location='dbxx_edit.asp';</script>"
%>