ASP+access搜索条输入多个关键词查询的问题
下面的代码,没法获取同一文本框多个用空格分格的关键词,为什么没起作用啊?谁能帮忙,谢谢!!cxsj=request("cxsj")
cxsj=Rtrim(LTrim(cxsj))
bb=request("bb")
dd=request("dd")
SearchUC=request("SearchUC")
dim pageCount
page = cint(request("page"))
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
conn.open "DBQ=" & server.mappath("SpiderResult1.mdb") & ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
sql="select * from xodntad where 1=1 "
sql="select * from xodntad where feng like '%%' "
Dim SearchStr
if instr(cxsj,"+")<>0 then ’这里同一文本框获取多个空格分开的关键词,没法获取什么原因,那里错了。
str = split(cxsj,"+")
for i=0 to ubound(str)
sql = sql&" and minqing like'%"&str(i)&"%'"
next
end if
if bb<>"" then
sql=sql&"and dindi like '%"&bb&"%'"
end if
if dd<>"" then
sql=sql&"and xodntad like '%"&dd&"%'"
end if
if SearchUC="" then
sql=sql&" order by id desc"
end if
if SearchUC="1" then
sql=sql&" and ping between 0.01 and 100.00 order by ping asc"
end if
rs.open sql,conn,1,1