ASP+sql2000如何处理批量用户,ASP高手请帮忙
这段代码是想一次清除掉所有到期会员,现在只读出来了,怎么能一次全清除呢?请大家帮忙<%ifovertype<>""thensetrs=server.CreateObjec...
这段代码是想一次清除掉所有到期会员,现在只读出来了,怎么能一次全清除呢?请大家帮忙
<% if overtype<>"" then
set rs=server.CreateObject("adodb.recordset")
if overtype="当天到期付费会员" then
sqlstr="select * from overtime where otime='" & date & "'"
elseif overtype="10天内到期付费会员" then
sqlstr="select * from overtime where otime<>'" & date & "'"
end if
'response.write overtype
'response.write "<p>" & sqlstr
rs.open sqlstr,conn,2,3
%> 展开
<% if overtype<>"" then
set rs=server.CreateObject("adodb.recordset")
if overtype="当天到期付费会员" then
sqlstr="select * from overtime where otime='" & date & "'"
elseif overtype="10天内到期付费会员" then
sqlstr="select * from overtime where otime<>'" & date & "'"
end if
'response.write overtype
'response.write "<p>" & sqlstr
rs.open sqlstr,conn,2,3
%> 展开
4个回答
展开全部
方法1
<% if overtype<>"" then
set rs=server.CreateObject("adodb.recordset")
if overtype="当天到期付费会员" then
sqlstr="select * from overtime where otime='" & date & "'"
elseif overtype="10天内到期付费会员" then
sqlstr="select * from overtime where otime<>'" & date & "'"
end if
'response.write overtype
'response.write "<p>" & sqlstr
rs.open sqlstr,conn,2,3
do while not rs.eof
rs.delete
rs.movenext
loop
response.write("全部删除成功")
%>
方法2
<% if overtype<>"" then
set rs=server.CreateObject("adodb.recordset")
if overtype="当天到期付费会员" then
sqlstr="delete from overtime where otime='" & date & "'"
elseif overtype="10天内到期付费会员" then
sqlstr="delete from overtime where otime<>'" & date & "'"
end if
conn.execute(sqlstr)
response.write("删除成功")
%>
<% if overtype<>"" then
set rs=server.CreateObject("adodb.recordset")
if overtype="当天到期付费会员" then
sqlstr="select * from overtime where otime='" & date & "'"
elseif overtype="10天内到期付费会员" then
sqlstr="select * from overtime where otime<>'" & date & "'"
end if
'response.write overtype
'response.write "<p>" & sqlstr
rs.open sqlstr,conn,2,3
do while not rs.eof
rs.delete
rs.movenext
loop
response.write("全部删除成功")
%>
方法2
<% if overtype<>"" then
set rs=server.CreateObject("adodb.recordset")
if overtype="当天到期付费会员" then
sqlstr="delete from overtime where otime='" & date & "'"
elseif overtype="10天内到期付费会员" then
sqlstr="delete from overtime where otime<>'" & date & "'"
end if
conn.execute(sqlstr)
response.write("删除成功")
%>
展开全部
if overtype="当天到期付费会员" then
sqlstr="delete from overtime where otime='" & date & "'"
elseif overtype="10天内到期付费会员" then
sqlstr="delete from overtime where otime<>'" & date & "'"
end if
sqlstr="delete from overtime where otime='" & date & "'"
elseif overtype="10天内到期付费会员" then
sqlstr="delete from overtime where otime<>'" & date & "'"
end if
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<%
if overtype="当天到期付费会员" then
sqlstr="delete from overtime where otime=date()"
elseif overtype="10天内到期付费会员" then
sqlstr="delete from overtime where otime<date() and otime>dateadd('d',-10,date())"
end if
Conn.execute(sqlstr)
%>
假如今天是2008-10-10,那就是删除2008-10-10到2008-10-1之间的数据
如果想删除 2008-10-10 到 2008-10-20 的数据把上面的-10改成10即可
if overtype="当天到期付费会员" then
sqlstr="delete from overtime where otime=date()"
elseif overtype="10天内到期付费会员" then
sqlstr="delete from overtime where otime<date() and otime>dateadd('d',-10,date())"
end if
Conn.execute(sqlstr)
%>
假如今天是2008-10-10,那就是删除2008-10-10到2008-10-1之间的数据
如果想删除 2008-10-10 到 2008-10-20 的数据把上面的-10改成10即可
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
同样道理
<%
删除当天到期付费会员
sqlstr="delete * from overtime where otime='" & date & "'"
删除10天内到期付费会员
sqlstr="delete * from overtime where otime<>'" & date & "'"
rs.open sqlstr,conn,2,3
%>
<%
删除当天到期付费会员
sqlstr="delete * from overtime where otime='" & date & "'"
删除10天内到期付费会员
sqlstr="delete * from overtime where otime<>'" & date & "'"
rs.open sqlstr,conn,2,3
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询