VBKid04
04-16-2004, 10:00 AM
I have a simple search running but I've found it to be pretty useless so far.
I'm not overly sure how search engines operate (ie. in their basic search, they seem to find your search string in records/fields where 2 or more words match), but maybe someone can enlighten me how to do this ?
I am trying to search a string for matches in one particular field, Can anyone help me alter my code so that it searches for:
-An exact match of search string to the field (Match exact phrase)
-A match where any of the words given are contained in the field in any order
(Match any word)
-A match where all of the words given are contained in the field (but maybe not having to be in the order they were given).
-A match where any of the words given are contained in field in similar order
(ie. If user entered "I am really confused" as the search string, it could pick out records that had strings such as "I am" or "really confused").
I know I may need a combo box for this, or cases, but can someone please guide me in the right direction as regards the queries?
My code so far is:
newMatchRS.Open "SELECT * From Task WHERE UCase(TaskInformation)
LIKE '%" & UCase(txtSearchCriteria) & "%' Order By TaskID", db,
adOpenStatic, adLockOptimistic
Thanks for any help
I'm not overly sure how search engines operate (ie. in their basic search, they seem to find your search string in records/fields where 2 or more words match), but maybe someone can enlighten me how to do this ?
I am trying to search a string for matches in one particular field, Can anyone help me alter my code so that it searches for:
-An exact match of search string to the field (Match exact phrase)
-A match where any of the words given are contained in the field in any order
(Match any word)
-A match where all of the words given are contained in the field (but maybe not having to be in the order they were given).
-A match where any of the words given are contained in field in similar order
(ie. If user entered "I am really confused" as the search string, it could pick out records that had strings such as "I am" or "really confused").
I know I may need a combo box for this, or cases, but can someone please guide me in the right direction as regards the queries?
My code so far is:
newMatchRS.Open "SELECT * From Task WHERE UCase(TaskInformation)
LIKE '%" & UCase(txtSearchCriteria) & "%' Order By TaskID", db,
adOpenStatic, adLockOptimistic
Thanks for any help