datepart要直接操作数据库,而不是放到vbs里面
conn.execute("delete * from tb_article where dztime is not null and replace(str(datepart(""yyyy"",dztime))+'-'+str(datepart(""m"",dztime)),' ','')<"&year(date())&"&-"&month(date())&" ")
if request("action")="del_yydz" then
if session("users_s")=1 then
conn.execute("delete * from tb_article where dztime is not null and "&datepart("yyyy","dztime")&"&-"&datepart("m","dztime")&"<"&year(date())&"&-"&month(date())&" ")
Response.Write "<script language='javascript'>alert('数据删除成功!);window.location.href('/index.asp');</script>"
else
Response.redirect("/index.asp")
end if
end if