Results 1 to 3 of 3

Thread: Searching

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    14
    I currently am working on a database program and would like to know how to search text fields to find close matches. I currently have the program to exact mactches but I would like I broader search to find exact and simlar matches. Any suggestions??


    ~Jeremy

  2. #2
    Lively Member Ishamel's Avatar
    Join Date
    Nov 1999
    Location
    Edinburgh, Scotland
    Posts
    112
    I think this is what you are after.

    This code, will return all the records that have 'ABC' anywhere within the data field.

    Code:
    mySearchString = "ABC"
    
    Set myResultSet = myCon.OpenResultSet("Select myField From myTable Where UPPER(myField) Like UPPER('%" & mySearchString & "%')")
    
    'Now you can start looping through all the records 
    'that contain 'ABC' within their text.
    This SQL statement is for searching an SQL Server database, so you might have to alter it slightly if you are wanting to search another type of database.
    The help files should tell you what wildcard to use instead of the % symbol.

    (The UPPER ysntax is optional. I've used it to remove any case sensitive issues.)

    Hope this helps.

    [Edited by Ishamel on 03-21-2000 at 09:22 AM]

  3. #3
    New Member
    Join Date
    Mar 2000
    Posts
    12

    Thumbs up

    It works!! Thanks Ishamel

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