Ok, heres the code I have... The problem is when someone selects to search for 'all' the words, NOTHING shows up no matter what is searched for... code below and description of all the variables...
Variables:
srchStringSize = size of the search query (array)
srchString1(I) = a single word of the query
srchIn = field of the database to search in
srchMatch = search for any of the keywords or all of them... any = 'OR' and all = 'AND'
ModSearchDisplay = output string
For I = 0 to srchStringSize
if not(Trim(srchString1(I)) = "") then
srchString1(I) = replace(srchString1(I), "'", "''")
srchString1(I) = replace(srchString1(I), Chr(34), """")
If I > 0 then
if srchIn = "all" then
strsql = strsql & " OR "
else
strsql = strsql & " " & srchMatch & " "
end if
end if
'Select SQL here
If srchIn = "all" then
strsql = strsql & "(AUTHOR LIKE '%" & srchString1(I) & "%' " & srchMatch & _
" DESCRIPTION LIKE '%" & srchString1(I) & "%' " & srchMatch & _
" MODNAME LIKE '%" & srchString1(I) & "%' " & srchMatch & _
" NAME LIKE '%" & srchString1(I) & "%' " & srchMatch & _
" SVERSION LIKE '%" & srchString1(I) & "%') "
else
strsql = strsql & " " & srchIn & " LIKE '%" & srchString1(I) & "%'"
end if
else
ModSearchDisplay = ModSearchDisplay & "<tr><td bgcolor=""" & strForumCellColor & """ colspan=4>You must enter a query</td></tr>"
end if
Next
If needbe I can post the entire Sub
----------
-Eric (da_stimulator)
Stims Snitz Test area - Running 3.3.03, 4 beta, and Huw's modified code
Need a Mod? Check out the Mod Resource
Edited by - da_stimulator on 10 November 2001 03:04:47