Problems with the ' symbol..

Discussion in 'ASP General' started by Graham Mattingley, Aug 12, 2003.

  1. Hi All,

    I have a database query where it looks like this

    strQuery = "UPDATE resource SET TITLE = ' "&request.form("TITLE")&" ' WHERE
    ID = '"&request.form("ID")&"';"

    the problem is that if the field called title has a ' in the text then the
    UPDATE fails, because I have closed the TITLE field early. If I reverse the
    " & ' marks then I will have the same problem but the opposite way.....

    I thought about doing something with ASP, replace but I still cant get round
    the fact that I will have a ' in the UPDATE statement..

    Can I do something like REPLACE ' with the CHAR code value and add the code
    in the SQL record, and will this display the ' or the code.

    Kind Regards

    Graham Mattingley
     
    Graham Mattingley, Aug 12, 2003
    #1
    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. Hash Symbol Link problems

    , Aug 3, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    7,533
  2. Travis Stewart

    Problems with function/header file, Undefined symbol

    Travis Stewart, Jul 29, 2003, in forum: C Programming
    Replies:
    1
    Views:
    454
    Malcolm
    Jul 29, 2003
  3. baumann@pan
    Replies:
    1
    Views:
    762
    Richard Bos
    Apr 15, 2005
  4. Song Ma
    Replies:
    2
    Views:
    251
    Charles Oliver Nutter
    Jul 20, 2008
  5. Replies:
    6
    Views:
    1,975
Loading...

Share This Page