Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Comments field problem 1

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US
Hello all, I have an ASP page that produces an error everytime all users type an apostrophe in the "COMMENTS" field.
Examples:
I'm going to Florida = Will not work
I am going to Florida = Will work just fine

Everytime an apostrophe is entered my ASP page thinks it's part of the script. I thank you in advance.

QUOTE OF THE DAY
Everyone you meet knows something you don't know. Be willing to learn from them.

Jr_Clown :eek:)
 
This will solve your apostrophe nightmare.

What ever variable you send to the SQL statment. Make sure you pass it through this line:

YOURVariable = replace(YOURVariable,"'","''")

It will replace the apostrophe with a double. Any problems email me with a snippit of your code and I will give you a hand.

Cheers
Matthew Wilde
matthew@ukwebsite.com
 
ice simple fix. I had this problem and fixed it with an
inSTR statement and then parseing out the ' - but this is far more simple.

In fact, my company name has an apostrophe in it and it causes scripts to break on my bank's website. I offered to fix it for them (at a ridiculous price :) ) but they haven't gotten back to me.

Steve Davis
hey.you@hahaha.com.au
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top