Apostrophes and SQL ''''''

Results 1 to 2 of 2

Thread: Apostrophes and SQL ''''''

  1. #1
    Join Date
    Dec 1969

    Default Apostrophes and SQL ''''''

    I used the FAQ on this site to resolve the problem of inserting apostrophes into a database. (Bascially using the replace function to insert two apostrophes). However when I do this I get 2 apostrophes in my database. I then commented out the replace function code and my insert works fine.<BR><BR>Does anyone know why this is? How come I am able to insert apostrophes fine, when there are so many articles / posts explaining how to do it? Is there a setting in Access that could allow this??<BR><BR>TIA<BR>Paul.

  2. #2
    Join Date
    Dec 1969

    Default It all depends on your SQL string

    This is if you are using a SQL string like:<BR><BR>strSQL = "INSERT INTO TableName (Foo) VALUES(&#039" & strFoo & "&#039)"<BR><BR>If you are using the ADO methods, like:<BR><BR>objRS.AddNew<BR>objRS("Foo") = strFoo<BR>objRS.Update<BR><BR>then you don&#039t need to use the double apostrphe thingie...

Posting Permissions

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