sql="select * from table_user where old='"&old&"' and name like '%"&name&"%' "
'查找年龄为某年 ,姓名模糊查询
if city<>empty then '判断city是否空值,
sql=sql+" and city="&city&" "
end if
if sex<>empty then
sql=sql+" and sex="&sex&" " '性别是数字字段
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,cnndb,1,1
sql9 = "select * from ozg"
sqlWhere = " where wtype = 24"
if texname <> Empty then
sqlWhere = sqlWhere & " and wauth = '" & texname & "' "
end if
if year <> Empty then
if Date1 = Empty then Date1 = "01"
if month = Empty then month = "01"
sqlWhere = sqlWhere & " and wdate >= '" & year & "-" & month & "-" & Date1 & "' "
end if
if year1 <> Empty then
if hDate2 = Empty then Date2 = "02"
if month1 = Empty then month1 = "02"
sqlWhere = sqlWhere & " and wdate <= '" & year1 & "-" & month1 & "-" & Date2 & "'"
end if
sql9 = sql9 & sqlWhere & " order by wauth,wsource desc"
<%
dim do_del
do_del=Request.Form("delete_zl")
if do_del="删除" then
if Request.Form("radio")=empty then
%>
<script language=vbscript>
msgbox"请选择要删除的文章!"
</script>
<%
else
if (rs("wworknum")=session("userwork")) or (session("userlegalpower")=0) then
map_del="./datum/"&Request.Form("radio")
path_del=server.MapPath(map_del)
set fs=server.CreateObject("Scripting.FileSystemObject")
fs.DeleteFile (path_del)
sql_del="delete from ozg where wname='"&Request.Form("radio")&"'"
cmd.CommandText=sql_del
cmd.Execute(sql_del)
%>
<script language=vbscript>
window.navigate "./yewu1.asp"
</script>
<%
else
%>
<script language=vbscript>
msgbox"您没有删除此文章的权限!"
</script>
<%
end if
end if
rs.Close
end if
%>