View Single Post
  #1 (permalink)  
Old July 1st, 2005, 09:04 AM
badgolfer badgolfer is offline
Friend of Wrox
 
Join Date: Sep 2003
Location: Whitstable, , United Kingdom.
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default using apostrophe in Access string fields

hi,
     I am using some simple string fields in a simple Access
database table. Sometimes I have apostrophes in the text data eg
in a name field I may have John O'Hara. If I build my insert
query this apostrophe causes me a problem eg
 "insert into mytable (name) values ('John O'Hara')"

the apostrophe in the O'Hara signals the end of the string and
my sql code fails. How can I overcome this ? Is there a way that
I can keep the original text in the data or do I have to substitute
the apostrophe character for something else like "`" ?

Cheers muchly.


Reply With Quote