Using " and ' in ASP

Results 1 to 2 of 2

Thread: Using " and ' in ASP

  1. #1
    Fearinke Guest

    Default Using " and ' in ASP

    Hi,<BR><BR>I am developing ASP scripts that have large text inputs but this leads to the following problem. If someone puts a &#039; or a " in the text area I get errors in the SQL syntax when using an SQL command. (And I get VBscript syntax errors.)<BR><BR>How would I fix this? Is there a way in ASP to use the hexadecimal value of the character to replace the &#039; or " ?<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Using

    Hi,<BR><BR>For the " ..<BR><BR>strName = Replace(strName, chr(34), "&quot;") or<BR>strName = Replace(strName, """", """""")<BR><BR>You&#039;ll have to play around and test the "" - see which method works best for you since it&#039;s been awhile since I played around with that stuff..<BR><BR>For the &#039; ..<BR><BR>strName = Replace(strName, "&#039;", "&#039;&#039;")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts