<%
where=""
if trim(request.QueryString("keyword"))<>"" then
where=where & "product_name like '%"&trim(request.QueryString("keyword"))&"%'"
end if
if trim(request.QueryString("keyword"))<>"" then
if where="" then
where=where & "xl like '%"&trim(request.QueryString("keyword"))&"%'"
else
where=where & "or xl like '%"&trim(request.QueryString("keyword"))&"%'"
end if
end if
if trim(request.QueryString("keyword"))<>"" then
if where="" then
where=where & "cplx like '%"&trim(request.QueryString("keyword"))&"%'"
else
where=where & "or cplx like '%"&trim(request.QueryString("keyword"))&"%'"
end if
end if
if trim(request.QueryString("keyword"))<>"" then
if where="" then
where=where & "jzm like '%"&trim(request.QueryString("keyword"))&"%'"
else
where=where & "or jzm like '%"&trim(request.QueryString("keyword"))&"%'"
end if
end if
if trim(request.QueryString("keyword"))<>"" then
if where="" then
where=where & "zz like '%"&trim(request.QueryString("keyword"))&"%'"
else
where=where & "or zz like '%"&trim(request.QueryString("keyword"))&"%'"
end if
end if
if trim(request.QueryString("keyword"))<>"" then
if where="" then
where=where & "bc like '%"&trim(request.QueryString("keyword"))&"%'"
else
where=where & "or bc like '%"&trim(request.QueryString("keyword"))&"%'"
end if
end if
if trim(request.QueryString("keyword"))<>"" then
if where="" then
where=where & "qhdj like '%"&trim(request.QueryString("keyword"))&"%'"
else
where=where & "or qhdj like '%"&trim(request.QueryString("keyword"))&"%'"
end if
end if
if trim(request.QueryString("keyword"))<>"" then
if where="" then
where=where & "jbhs like '%"&trim(request.QueryString("keyword"))&"%'"
else
where=where & "or jbhs like '%"&trim(request.QueryString("keyword"))&"%'"
end if
end if
if trim(request.QueryString("keyword"))<>"" then
if where="" then
where=where & "drbh like '%"&trim(request.QueryString("keyword"))&"%'"
else
where=where & "or drbh like '%"&trim(request.QueryString("keyword"))&"%'"
end if
end if
if trim(request.QueryString("keyword"))<>"" then
if where="" then
where=where & "bz like '%"&trim(request.QueryString("keyword"))&"%'"
else
where=where & "or bz like '%"&trim(request.QueryString("keyword"))&"%'"
end if
end if
if where<>"" then
where="where "&where
end if
if where="" then
response.Write "<script language=javascript>alert('搜索內容不能不空!');javascript:history.go(-1)</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from ecn " & where & "and pass=1 order by product_name desc"
'response.write sql & "<br>"
rs.open sql,conn,1,1
%>
执行结果 不执行pass=1 这个条件!请高手看下