CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Location
    Norway
    Posts
    19

    Wildcard searching in CRecordSet

    Hello!

    Could anybody answer me why CRecordSet does not fetch any datarecords from a database when the sql includes wild cards.

    I just formated a CString with a * as the wild card character. This caused no records to be found. The sql is completely correct and it executes well in access. Shall I maybe use some other methode than *?

    Thanks in forward.
    Hussam


  2. #2
    Join Date
    Jun 2002
    Posts
    9
    What you want to use is %.

    example

    SELECT * FROM mytable WHERE name LIKE 'T%'

    this will return everthing that has a name that starts with T.

    If you would like to return every thing that has a T in the name use '%%T%%'.



    Seeing what others do not see is called brilliance, knowing what others do not know is called genius.

    --Sun Tzu

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

Featured