here's the code I was talking about... i'm just gonna cut and paste it... i'll add a few comments here and there, but you will need to adapt this to your needs....
<%
'creates where clause parsing for AND, OR, and ""
'@strResult - string of the form input
'@field - db field to match against
'returns WHERE condition (without the WHERE)
FUNCTION processStr(strResult, field)
if strResult <> "" then
Response.Write field & "s for : " & strResult & "<br>"
dim re, reMatch, item, boolStr, value, quoteStr, otherStr
boolStr = ""
otherStr = ""
quoteStr = ""
strResult = lcase(strResult)
set re = new RegExp
re.IgnoreCase = true
re.Global = true
'GET THE and ""
re.Pattern = "\sand\s+"".*?"""
set reMatch = re.Execute(strResult)
For Each item in reMatch
value = " " & replace(item.value, """",""

value = trim(replace(value, " and ", ""

)
quoteStr = quoteStr & " AND (" & field & " LIKE '%" & value & "%')"
Next
strResult = re.Replace(strResult, " "
'GET THE or ""
re.Pattern = "\sor\s+"".*?"""
set reMatch = re.Execute(strResult)
For Each item in reMatch
value = " " & replace(item.value, """",""

value = trim(replace(value, " or ", ""

)
quoteStr = quoteStr & " OR (" & field & " LIKE '%" & value & "%')"
Next
strResult = re.Replace(strResult, " "
'GET REST OF ""
re.Pattern = """.*?"""
set reMatch = re.Execute(strResult)
For Each item in reMatch
value = trim(replace(item.value, """",""

)
quoteStr = quoteStr & " AND (" & field & " LIKE '%" & value & "%')"
Next
strResult = re.Replace(strResult, " "
re.Pattern = "\sand\s+\w+"
set reMatch = re.Execute(strResult)
For each item in reMatch
boolStr = boolStr & " AND (" & field & " LIKE '%" & trim(Replace(item.value," and ",""

) & "%') "
Next
strResult = re.Replace(strResult," "
re.Pattern = "\sor\s+\w+"
set reMatch = re.Execute(strResult)
For each item in reMatch
boolStr = boolStr & " OR (" & field & " LIKE '%" & trim(Replace(item.value," or ",""

) & "%')"
Next
strResult = re.Replace(strResult," "
re.Pattern = "\s{2,}"
strResult = trim(re.Replace(strResult," "

)
set re = nothing
dim i, strArr, arrUB
strArr = Split(strResult," "

arrUB = Ubound(strArr)
For i = 0 to arrUB
otherStr = otherStr & " AND (" & field & " LIKE '%" & strArr(i) & "%') "
Next
'check otherStr, quoteStr, and boolStr
if otherStr = "" then
if quoteStr = "" then
if boolStr = "" then
'RAISE ERROR!
else
processStr = boolStr
end if
else
if boolStr = "" then
processStr = quoteStr
else
processStr = quoteStr & boolStr
end if
end if
else 'otherStr has something
otherStr = Right(otherStr, Len(otherStr) - 4)
if quoteStr = "" then
if boolStr = "" then
processStr = otherStr
else
processStr = otherStr & boolStr
end if
else
if boolStr = "" then
processStr = otherStr & quoteStr
else
processStr = otherStr & quoteStr & boolStr
end if
end if
end if
end if
END FUNCTION
'processes the basic search form
'@QS - string holding form input
'returns sql query
FUNCTION basic(QS)
Response.write "Searched : <br>"
frmQry = "?qry=" & Server.URLEncode(QS)
Dim tempRes
tempRes = processStr(QS, "message"

tempRes = correctSQL(correctSQL(tempRes,false), true)
basic = Trim(tempRes)
END FUNCTION
'function strips out the extra ANDs & ORs
'@str - string to format
'@start - boolean to determine where to check
'returns formatted string
FUNCTION correctSQL(str, start)
if start then
if InStr(str," AND"

< 4 and InStr(str," AND"

<> 0 then
str = Right(str,Len(str) - 4)
elseif InStr(str," OR"

< 4 and InStr(str," OR"

<> 0 then
str = Right(str,Len(str) - 3)
end if
else
if InStrRev(str," AND"

> Len(str) - 4 then
str = Left(str,Len(str) - 3)
elseif InStrRev(str," OR"

> Len(str) - 4 then
str = Left(str,Len(str) - 2)
end if
end if
correctSQL = str
END FUNCTION
basic(Request.Form("search_query"

)
%>
This hasn't been tested as a cut and paste type setup, I know that it works in my scenario though....
hth you...
leo