Results 1 to 3 of 3

Thread: [RESOLVED] ADO Search Agorithm

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    230

    Resolved [RESOLVED] ADO Search Agorithm

    Do anybody know an good algorith to search a string by ado

    Let say i have
    SELECT * FROM StrTemp WHERE [Search] LIKE '%" & Search & "%'

    i want to find = "John Miller"

    In the database i have a string like: "I am Miller John", so i just want to know how can i use ADO to find that string, with the "John Miller" or "Miller John" critia.

    Thanks
    Of course i can't loop all the string in the database, because i have 100 000 records, it gonna take to much time.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: ADO Search Agorithm

    The simplest way is to use multiple Like conditions, one for each word, eg:
    Code:
    SELECT * FROM StrTemp 
    WHERE [Search] LIKE '%John%'
      AND [Search] LIKE '%Miller%'
    Depending on which language you are using, you may be able to use the Split function to get the words from the search criteria.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    230

    Re: ADO Search Agorithm

    thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width