Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Double and single quotes in SQL string (A2K)

    I understand, or think I understand, all the nuances of SQL statements updating string with values that include single and double quotes. I have to update latitude and longitude values which will always carry a single quote and a double quote in the string. How can I use SQL to insert/update such a value? I have a workaround that leaves me dissatisfied; I would prefer to do it correctly, so that the exact, correct values are stored in the database. Help!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Double and single quotes in SQL string (A2K)

    Surround the values in single quotes, and replace each single quote within a value by two single quotes, and each double quote within the value by two double quotes.

    <code>strSQL = "UPDATE tblLongitudes SET Longitude = '12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •