Results 1 to 5 of 5

Thread: SQL question using DAO...Concerning Quotes

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    norcross, ga, USA
    Posts
    82

    Post

    Example SQL statement:

    txtTitle.Text = "Frame's"

    "SELECT Titles as intTitle WHERE Title = '" & txtTitle.Text & "'"

    It gives me an error referring to the single quotation in Frame's.

    I tried replacing the Frame's with Frame\'s and even Frame/'s but it still didn't like it. If I remove the single quote then it behaves properly!

    How can I fix this? I would like NOT to eliminate single quotes from my database!

    Thanks in advance!

    <c>

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Use 2 single quotes in place of a double quote

    If you have VB6, you can use the REPLACE function to easily do this for you

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    norcross, ga, USA
    Posts
    82

    Post

    Maybe I didn't make myself clear...

    User wants to search for an item in the database.

    The item is Frame's, so they type frame's.

    But it doesn't return frame's because of the single quotation or apostrophy or whatever it's called.

    My question is how do I allow them to search for something that has a single quote in it.

    <c>

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Sorry, I mistyped

    Use two single quotes instead of one single quote when searching


    ...Just try it

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    norcross, ga, USA
    Posts
    82

    Post

    Thanks, Clunietp.

    Seems to be working fine now.

    <c>

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