searching a phrase in database

01-13-2004, 06:20 AM

I tried to implement a search engine where it is possible to split the input into words and search for them considering the options of searching for all the words, any of the words or as a phrase.

I managed to code the part for searching all and any of the words but the part for searching for a phrase doesn't seem to work...

For splitting the input I used (that is being used for searching word by word):

retString1 = Split(txtInput.Text, " ")

and for joining to search as a phrase I used:

strDisplay = Join(retString1)
SQL = SQL & " Author LIKE '%strDisplay%'"

I believe there is something wrong with '%strDisplay% part of it.

Any ideas?


01-13-2004, 06:43 AM
Check. Use '%" & strDisplay & "%'...

01-13-2004, 06:46 AM
what is your complete SQL statement.....but you need to space out your like statement a little bit such as:

LIKE '%"& Trim(Text1.text) & "%'"

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum