We often encounter multiple keywords in the Web development of a single field. We are generally implemented through dynamic array. Of course, multiple keywords are generally used in space or separated. This article assumes that multiple keywords are separated by spaces. The keyword string is keystr, and the specific code is.
Program code:
The following is the reference content:
'Search for keywords
Str = SELECT * From Tableename WHERE ID> 4
if srhkey <> then
Keyarr = split (srhkey,)
j = ubound (keyarr)
T = 0
DIM Keystrarr ()
for i = 0 to j
if keyr (i) <> then
Redim 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) &%)
Keystrarrrrrrrrrrrrr (t) = strfilter
t = t+1
end if
next
Keystr = Join (Keystrarrrrrrrrrrrrrrrdish)
Str = Str & AND & Keystr
end if