Results 1 to 4 of 4

Thread: Problem with LIKE in SQL

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Guatemala
    Posts
    5

    Post

    I'm trying to use the Like operator in SQL Sentece, but it doesn't work, it doesn't found the data. I'm using the following instructions:

    strSearch= "SELECT Code, Name FROM Employees WHERE Name Like 'C*'"

    ADOrs.Open strSearch, db, adOpenStatic, adLockOptimistic

    I'd tried this same instruction in ACCESS 97 and it works fine.

    Why in VB6 doesn't work?

    Thanks for your time.

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    I don't do ADO, but your SQL syntax works in DAO, so I suspect the problem is in the Open statement. What happens when you run it? Do you get an error, or zero records returned, or...?

    ------------------
    Marty
    What did the fish say when it hit the concrete wall?
    > > > > > "Dam!"

  3. #3
    Member
    Join Date
    Jan 2000
    Location
    Singapore
    Posts
    59

    Post

    Hai Jose,
    I also tried it before. But if you use * it is not responding.
    use % as a wildcard to search. It will work in ADO.

    Hope you will get your problem solved.
    Thanks
    Karun

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Guatemala
    Posts
    5

    Post

    Thanks Karun, With % WildCard works perfectly.

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