在web開發中經常遇到多關鍵詞對對單個字段查詢
程序代碼
以下為引用的內容
str="select * from tableName where id>
if srhKey<>"" then
keyArr=split(srhKey
j=UBound(keyArr)
t=
dim keystrArr()
for i=
if keyArr(i)<>"" then
redim preserve keystrArr(t)
strfilter="(empZw like
strfilter=strfilter&keyArr(i)&"%
strfilter=strfilter&"%
keystrArr(t)=strfilter
t=t+
end if
next
keystr=join(keystrArr
str=str&" and "&keystr
end if
From:http://tw.wingwit.com/Article/program/net/201311/14286.html