sql problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • charvi
    New Member
    • May 2007
    • 121

    sql problem

    i have a syntax problem in access
    i have a table with fields name and code
    for eg name-dana int'l & code=dl
    now i want to fetch this data in other form
    when i use select query it gives error saying operatop missing
    that is if i write dana intl it will execute
    instead if i write dana int'l i will get error
    pls help me
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by charvi
    i have a syntax problem in access
    i have a table with fields name and code
    for eg name-dana int'l & code=dl
    now i want to fetch this data in other form
    when i use select query it gives error saying operatop missing
    that is if i write dana intl it will execute
    instead if i write dana int'l i will get error
    pls help me

    you have to search like

    Code:
    strSql="select <Fields> from <Table Name> where <SearchField> Like "
    strSql=strSql & " 'dana int''l' "
    'dana int''l -> <single quot>dana int<single quot><single quot>l<single quot>

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      For more info, refer to the following links...
      List of articles and code snippets in Access forum
      Quotes and Double-Quotes - Where and When to use them
      VB example - how to search on string containing an apostrophe

      Comment

      Working...