We help IT Professionals succeed at work.
Get Started

Best Practices for replacing single quotes (as in the name O'Neill) to be able to include it in SQL Insert or Update query strings.

Last Modified: 2008-09-17
There are many suggested ways to do this in the knowledge base.  I frequently build extended (multiple fields) query strings during processing so I need to be able to use single quotes to deliniate character strings being put into text fields.  Should I:

  Store substitue characters for the single quotes in the fields - ackward when the table is also being used directly in Access (my storage database),
  Process each field individually using a variable to accomplish the insert/update - isn't this a lot of database thrashing, or
  (hopefully) something else that is a bit more elegant (efficient).

I didn't include code because their are a gillion ways to do each of my first two listed alternatives.  I'm really interested in a third alternative.
Watch Question
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE