access with

Posted on 2005-04-08
Last Modified: 2010-04-07
I am trying to link with access (something I hate to do).  I am trying to run the following query from vb:

SELECT firstName, lastName FROM people WHERE lastName LIKE 'K*'

when I run it in my DB directly, it works, but when I run it through the code, nothing gets returned.  The connection to the DB works just fine otherwise.  Any ideas??  I have a question open in the Access section too.  Any answers will get credit for both.
Question by:ARACK04
    LVL 4

    Expert Comment

    you will have to post all of the data access code for use to understand why it isn't working
    LVL 16

    Accepted Solution

    Give this a try:
    SELECT firstName, lastName FROM people WHERE lastName LIKE '%"K"%'
    SELECT firstName, lastName FROM people WHERE lastName LIKE '*"K"*'

    In Access, it's one of these, I forget which one . . I think the first:
    WHERE lastName LIKE '%" & varSearch & "%'
    WHERE lastName LIKE '*" & varSearch & "*'

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now