Results 1 to 4 of 4

Thread: Select SQL statement with * as wildcard character

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2004
    Location
    Australia
    Posts
    30

    Select SQL statement with * as wildcard character

    I am trying to populate a combo box with a subset of names from an Access data base using the * character.

    The Debug.Writeline text of the SQL statement I am using in the SELECT statement is:

    SELECT TBLNames.Name FROM TBLNames WHERE (((TBLNames.Name) Like "Rob*"))

    This SQL statement works within the Access db itself to return all names starting with Rob.

    But in .NET it only returns the name, Rob*, if I force that into the db.

    Can anyone help?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    Try using % instead of * (and _ instead of ?)

  3. #3
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    You want Rob to be in single quotes, not double.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2004
    Location
    Australia
    Posts
    30
    Thanks a lot, Si - the % worked straight up.

    You've saved me some hours of hassle tonight!!

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