<% dim sql
if keyword="" and adprofession="所有行业" and adinplace="所有地区"then
sql="select * from adtable"
elseif keyword="" and adprofession<>"所有行业" and adinplace="所有地区"then
sql="select * from adtable where adprofessin='"&adprofession&"'"
elseif keyword="" and adprofession="所有行业" and adinplace<>"所有地区"then
sql="select * from adtable where adinplace='"&adinplace&"'"
elseif keyword="" and adprofession<>"所有行业" and adinplace<>"所有地区"then
sql="select * from adtable where adinplace='"&adinplace&"'and adprofession='"&adprofession&"'"
elseif keyword<>"" and adprofession="所有行业" and adinplace="所有地区"then
sql="select * from adtable where adname like '%"&keyword&"%'"
elseif keyword<>"" and adprofession<>"所有行业" and adinplace="所有地区"then
sql="select * from adtable where adname like '%"&keyword&"%' and adprofession='"&adprofession&"'"
elseif keyword<>"" and adprofession="所有行业" and adinplace<>"所有地区"then
sql="select * from adtable where adname like '%"&keyword&"%' and adinplace='"&adinplace&"'"
else if keyword<>"" and adprofession<>"所有行业" and adinplace<>"所有地区"then
sql="select * from adtable where adname like '%"&keyword&"%'and adprofession='"&adprofession&"' and adinplace='"&adinplace&"'"
else
end if
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<center><br><font color=red size=2>对不起,暂无广告!</font></font>"
'response.End
else
%