title: Excel Vba - Using an apostrophe in an sql string
body: <p>I'm using excel to input data into an Access database and some of my data strings contain an apostrophe for measurements. </p>
  
  <p>This is my SQL input string</p>
  
  <pre><code>    stSQL = "INSERT INTO Products (ProductName, ProductDescription, ProductUnit, SupplierID) " &amp; _
              "Values ('" &amp; cboxItemNum &amp; "', '" &amp; txtDescription &amp; "', '" &amp; txtUnit &amp; "', " &amp; linkPID &amp; ")"
  
      cn.Execute (stSQL)
  </code></pre>
  
  <p>My string is as follows:</p>
  
  <p>Aliplast 4E White. 30" X 80' X 1/4" Soft.</p>
  
  <p>In this string the ' after the 80 is causing the error and I'm not sure how to get around this. I can't just tell the user not to enter an apostrophe. How can I get around this?</p>
  
  <p>Thanks</p>