Having problems parsing out a search string nto a string variable.

Results 1 to 2 of 2

Thread: Having problems parsing out a search string nto a string variable.

  1. #1
    Chad Franklin Guest

    Default Having problems parsing out a search string nto a string variable.

    I need to parse out a searh string into a string variable. So if a user searched on "Magnum P I", my variable would contain (Description LIKE &#039%Magnum%&#039 AND Description LIKE &#039%P%&#039 AND Description LIKE &#039%I%&#039). I used the code supplied at http://4guysfromrolla.com/webtech/111098-1.shtml but this is not working for me. My search engine will not find anything. If I search on one word such as Magnum it will pick it up fine. Could you email me the results at chad.franklin@jus.gov.on.ca Thankyou

  2. #2
    Lance King Guest

    Default RE: Having problems parsing out a search string nto a string variable.

    If you want to parse out based on the spaces you could use the Replace() function:<BR><BR>Dim strYourString<BR>strYourString = Trim("Magnum P I")<BR>sql = "SELECT * FROM TableName"<BR>sql = sql & " WHERE Description LIKE &#039%" & Replace(strYourString," ","%&#039 AND Description LIKE &#039%") & "%&#039"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •