条件语句为:
<%
dim key,rs,sql,Pagesize,Allrecord,Allpage,ThisPage,id,rs1,sql1,js1,bj1,tr1,rs2,xq1,zc1
key=trim(request("key"))
if (request("js"))="" then
js1="1 and"
else
js1=" js='"& request("js")&"' and "
end if
if (request("bj"))="" then
bj1="2 and"
else
bj1=" bj='"&request("bj")&"' and "
end if
if request("tr")="0" then
tr1="3 and "
else
tr1=" tr='"& request("tr")&"' and "
end if
if (request("xq"))="" then
xq1="4 and"
else
xq1=" and xq like '%" & request("xq") & "%'"
end if
if (request("zc"))="" then
zc1="5 and "
else
zc1=" and zc like '%" & request("zc") & "%'"
end if
%>
数据库查询为:
<%
set rs = server.createobject("adodb.recordset")
sql = "select * from [kbcx] where " & js1 &" "& bj1 &" "& zc1 &" " & tr1 & _
" key like '%" & key & "%'" & xq1
response.write ""&sql&""
rs.open sql,conn,1,1
%>