Problems with the ' symbol..

G

Graham Mattingley

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top