What about replace " with "?   You can reverse the replacement if you
need to output the ad in a form control, text file, report file, etc.

-----Original Message-----
From: Dixon, Aidan [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 06, 2000 9:08 AM
To: CF-Talk
Subject: Escaping quotes in Replace function for SQL Server 7


We have a classified ads section on our intranet currently running on MS
Access.  I'm trying to upgrade it to use MS SQL Server 7.  Testing threw up
one problem.  Data entry is via a standard HTML form, using a textbox for
the body of the ad.  Unfortunately, if anybody uses a double quote mark
anywhere in the text, all text following and including the first double
quote mark is truncated.  The code works fine with Access--I can post the
full code if need be, but there's nothing unexpected--so it seems to be a
SQL Server problem.

Now, if there's a setting in SQL Server I can change to fix this, I'd love
to know.  (Owing to Computer Services parsimony, I have no SQL Server
documentation.)  But this is a CF mailing list so I'm trying for a CF
solution.

I'd like to use the Replace function to replace any double quotes with
single quotes (preferably two single quotes together, since SQL Server has
no problem with single quotes), unfortunately I can't work out how to (or
even if I can) escape the single quotes in the CF code.  I've managed to
replace double quotes with spaces, like so:

    Replace(FORM.Ad_Body,""""," ","ALL")

but the result looks ugly.  However, no amount of doubling single quotes in
the above code will escape them successfully.  Am I barking up the wrong
tree here?

TIA,

Aidan.

-----
Aidan Dixon
Web Developer, Electronic Media Unit
The Royal Veterinary College,
Royal College St., London NW1 0TU.
Tel: +44 (0)20 7468 5173
Fax: +44 (0)20 7383 0615
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to