Replacing quotation marks

Discussion in 'ASP General' started by J. Muenchbourg, Aug 19, 2003.

  1. 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!
    J. Muenchbourg, Aug 19, 2003
    #1
    1. Advertising

  2. "" = 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 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!
    >.
    >
    John Beschler, Aug 19, 2003
    #2
    1. Advertising

  3. J. Muenchbourg

    Alan Guest

    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" <> wrote in message
    news:#...
    > 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!
    Alan, Aug 19, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Radith

    Using quotation marks

    Radith, Jan 7, 2005, in forum: Java
    Replies:
    1
    Views:
    434
  2. Replies:
    0
    Views:
    592
  3. Tristan Miller
    Replies:
    54
    Views:
    1,458
    ???????? ????? ???????????
    Nov 6, 2003
  4. M. Clift

    String and quotation marks

    M. Clift, Oct 22, 2004, in forum: Python
    Replies:
    2
    Views:
    374
    M. Clift
    Oct 22, 2004
  5. Peng Yu

    Question about concatenating quotation marks

    Peng Yu, Oct 1, 2004, in forum: C Programming
    Replies:
    3
    Views:
    351
    Mark McIntyre
    Oct 2, 2004
Loading...

Share This Page