Multiple Keyword Search
Hi Lists,
I hope somebody out there would be able to help with my problem. I have and access database and asp pages that i would like to do a search base on single word, two or more words and phrases but finding some difficulty with it. At the moment i can only do one word search and if i try to do more words it generates an error.
How can i use the code below to search for multiple keywords?
The code i am using is below:
Private Function sqlString(ByVal keyword)
sqlString = "SELECT * FROM qryMetaData "
sqlString = sqlString & "WHERE "
sqlString = sqlString & "((Abstract LIKE '%" & Replace(Keyword, "'", "''") & "%') OR (Title LIKE '% " & Replace(Keyword, "'", "''") & "%')) "
If DataType = "2" then
sqlString = sqlString & " AND (DATAFORM LIKE '%MapInfo%') "
Elseif DataType = "3" then
sqlString = sqlString & " AND ((DATAFORM = 'PDF') OR (DATAFORM = 'IMAGE')) "
End if
sqlString = sqlString & "ORDER BY [TITLE] ASC;"
End Function
Any help would be deeply appreciated.
Thank you in advance
|