CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Location
    Beaverton, OR
    Posts
    241

    What's wrong with this query?

    I have the following ADO line in my program:
    adoRS.Open "Select Ssn From Participants Where [Full Name] Like '" & strParticipant & ",*';", adoConn


    The query returns no record (adoRS.EOF = True), even though the name appears in the database. In other words, if strParticipant is 'Smith', the query does not find 'Smith, John'. Any ideas?

    Thanks in advance,

    Jamie Nordmeyer
    Portland, OR, USA


  2. #2
    Join Date
    Apr 1999
    Location
    Beaverton, OR
    Posts
    241

    Re: What's wrong with this query?

    Forgot to mention; the database is an Access 2.0 database (Yech, I know, but it's what I have to work with), and I'm using ADO 2.5.


  3. #3
    Join Date
    Jan 2000
    Location
    Saskatchewan, Canada
    Posts
    595

    Re: What's wrong with this query?

    Any queries on an access db using 'like' uses the wildcard character '%' and not the '*'.


    David Paulson

  4. #4
    Join Date
    Apr 1999
    Location
    Beaverton, OR
    Posts
    241

    Re: What's wrong with this query?

    Hmph! Figures. What's up with that? Who ever decided to use '%' instead of '*' (which is the standard, correct?) should be fired. Oh well. Thanks for the tip. It works now.


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