you need a string parser and the rest is easy.
here is a pseudo code:
myprefix = "[Catalog][Select] like "
get first word (from first letter to next space)
if first letter is equal to " then
j = location of "
k = locate next occurance of " [use instr]
myword = mid(mystring, j, k - j + 1)
myword = myprefix & "%" & myword & "%"
else
j = location of first letter
k = locate next occurance of space
myword = mid(mystring, j, k - j + 1)
myword = myprefix & "%" & myword & "%"
do until not yet end of mystring
get next word (from first letter to next space)
if first letter is equal to "+" then
myword = myword & " AND "
get next letter
if letter is equal to " then
j = location of "
k = locate next occurance of " [use instr]
myword = mid(mystring, j, k - j + 1)
myword = myprefix & "%" & myword & "%"
else
j = location of first letter
k = locate next occurance of space
myword = mid(mystring, j, k - j + 1)
myword = myprefix & "%" & myword & "%"
else
myword = myword & " OR "
get next letter
if letter is equal to " then
j = location of " k = locate next occurance of " [use instr]
myword = mid(mystring, j, k - j + 1)
myword = myprefix & "%" & myword & "%"
else
j = location of first letter
k = locate next occurance of spacemyword = mid(mystring, j, k - j + 1)
myword = myprefix & "%" & myword & "%"
mysql = "SELECT * from [Catalog] where " & myword
rs.open mysql, myconn
hope this helps.