Often encounter much keyword to inquire to single field in Web development, I come true commonly through dynamic array. Of course of many keywords is commonly use blank space or, separate, I this a few hypothesis many keywords are separated with blank space, key word string is KeyStr, specific code is.
Program code:
The search of ' key wordStr= "select * From TableName Where Id>4 "If SrhKey<>"" ThenKeyArr=split(srhKey, "" )J=UBound(keyArr)T=0Dim KeystrArr()For I=0 To JIf KeyArr(i)<>"" ThenRedim Preserve KeystrArr(t)Strfilter= "(empZw Like '%" &keyArr(i)&"%' Or EmpDep Like '%" &keyArr(i)&"%' Or EmpGz Like '% "Strfilter=strfilter&keyArr(i)&"%' Or EmpWy1 Like '%" &keyArr(i)&"%' Or EmpWy2 Like '%" &keyArr(i)Strfilter=strfilter&"%' Or EmpYq Like '%" &keyArr(i)&"%' Or Com_name Like '%" &keyArr(i)&"%') "KeystrArr(t)=strfilterT=t 1End IfNextKeystr=join(keystrArr, "And " )Str=str&"And " &keystrEnd If
ASP handles much keyword to inquire example code
来源:
作者:Stand originally
时间:2008-12-21
Tag:
点击:
最新评论共有 0 位网友发表了评论
查看所有评论
发表评论

