469,336 Members | 5,233 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

Replacing quotation marks

The following removes any unwanted apostrophes before being inserted
into an sql database:

Articletext = replace(articleText,"'","''")

..but if I need to remove all quotation marks, this doesnt work:

Articletext = replace(articleText,""","''")
????
Muench

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
2 11530
"" = empty string
""" = empty string + extra "

To place a " into a string use "".

Your code would then be:
Articletext = replace(articleText,"""","''")
or alternately:
Articletext = replace(articleText,CHR(34),"''")

HTH,
John


-----Original Message-----
The following removes any unwanted apostrophes before being insertedinto an sql database:

Articletext = replace(articleText,"'","''")

..but if I need to remove all quotation marks, this doesnt work:
Articletext = replace(articleText,""","''")
????
Muench

*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
.

Jul 19 '05 #2
You need to double-up apostrophes to stop them interfering with the
delimiters needed around textual column contents - why do you need to
double-up quotes?

Alan

"J. Muenchbourg" <jo*****@canada.com> wrote in message
news:#w**************@TK2MSFTNGP09.phx.gbl...
The following removes any unwanted apostrophes before being inserted
into an sql database:

Articletext = replace(articleText,"'","''")

.but if I need to remove all quotation marks, this doesnt work:

Articletext = replace(articleText,""","''")
????
Muench

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Stephen Poley | last post: by
63 posts views Thread by Tristan Miller | last post: by
4 posts views Thread by Thomas Miskiewicz | last post: by
reply views Thread by Aaron Deskins | last post: by
31 posts views Thread by The Bicycling Guitarist | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.