Set rs= Server.CreateObject ("ADODB.RecordSet")
if typeid<>"b" and chanye<>"a" and touzhi<>"c" and keyword<>"" then
sql = "select * from goods where typeid='"&typeid&"'and touzhi='"&touzhi&"' and chanye='"&chanye&"' and typeid1 like '%"&keyword&"%'"
elseif typeid="b" and chanye="a" and keyword="" and touzhi="c" then
sql = 这里该怎么写?????????????????????
elseif typeid="b" and chanye="a" and keyword<>"" and touzhi="c" then
sql = "select * from goods where typeid1 like '%"&keyword&"%'"
elseif typeid="b" and chanye<>"a" and keyword="" and touzhi="c"then
sql = "select * from goods where chanye='"&chanye&"'"
elseif typeid<>"b" and chanye="a" and keyword="" and touzhi="c"then
sql = "select * from goods where typeid='"&typeid&"'"
elseif typeid="b" and chanye="a" and keyword="" and touzhi<>"c"then
sql = "select * from goods where touzhi='"&touzhi&"'"
elseif typeid<>"b" and chanye<>"a" and keyword="" and touzhi="c"then
sql = "select * from goods where typeid='"&typeid&"'and chanye='"&chanye&"'"
elseif typeid<>"b" and chanye="a" and keyword<>"" and touzhi="c"then
sql = "select * from goods where typeid='"&typeid&"'and typeid1 like '%"&keyword&"%'"
elseif typeid="b" and chanye<>"a" and keyword<>"" and touzhi="c"then
sql = "select * from goods where chanye='"&chanye&"' and typeid1 like '%"&keyword&"%'"
elseif typeid="b" and chanye="a" and keyword<>"" and touzhi<>"c"then
sql = "select * from goods where typeid1 like '%"&keyword&"%' and touzhi='"&touzhi&"'"
elseif typeid<>"b" and chanye="a" and keyword="" and touzhi<>"c"then
sql = "select * from goods where typeid='"&typeid&"'and touzhi='"&touzhi&"'"
elseif typeid="b" and chanye<>"a" and keyword="" and touzhi<>"c"then
sql = "select * from goods where chanye='"&chanye&"'and touzhi='"&touzhi&"'"
elseif typeid<>"b" and chanye<>"a" and keyword="" and touzhi<>"c"then
sql = "select * from goods where typeid='"&typeid&"'and chanye='"&chanye&"' and touzhi='"&touzhi&"'"
elseif typeid="b" and chanye<>"a" and keyword<>"" and touzhi<>"c"then
sql = "select * from goods where chanye='"&chanye&"' and typeid1 like '%"&keyword&"%' and touzhi='"&touzhi&"'"
elseif typeid<>"b" and chanye="a" and keyword<>"" and touzhi<>"c"then
sql = "select * from goods where typeid='"&typeid&"'and typeid1 like '%"&keyword&"%' and touzhi='"&touzhi&"'"
elseif typeid<>"b" and chanye<>"a" and keyword<>"" and touzhi="c"then
sql = "select * from goods where typeid='"&typeid&"'and chanye='"&chanye&"' and typeid1 like '%"&keyword&"%'"
end if