Assume you stored the value of your input from the text box to string variable (temporary) sString. The replace replaces all instances of the single quote in the string variable to double quotes so SQL doesn't complain.
-----Original Message----- From: Pam <[EMAIL PROTECTED]> Sent: Aug 22, 2005 3:52 PM To: [email protected] Subject: RE: [ASP] using quotes in forms > > Pam: > > You should always get an error. Curious that you don't (unless for some > reason: the string has two quotes). > Very likely since the are small articles that may well have quoted material included. > Anyway: prior to entering the data into the database: you should do a > replace on the string. > > sString = Replace(sString,"'","''") > I'm still sort of like in (upper) elementary school as far as asp goes. Could you help me understand what we are doing with sString? Thanks, Pam > > HTH > Andy > > _____ > > From: [email protected] > [mailto:[EMAIL PROTECTED] > Sent: Monday, August 22, 2005 1:37 PM > To: [email protected] > Subject: [ASP] using quotes in forms > > > Hi, > I am using an online form to enter short article data into a > MySql database. > If I use an apostrophe or a quotation mark in the article text > that I enter > into the form field I will almost always (but not always) get an error > message and the data does not get posted. Is there something I can do to > allow quotes and apostrophes to be used in an online form? > > Thanks, > Pam --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h8mkl1a/M=362131.6882499.7825260.1510227/D=groups/S=1705115381:TM/Y=YAHOO/EXP=1124818265/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org ">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life - brought to you by One Economy</a>.</font> --------------------------------------------------------------------~-> --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
