ASP Insert Text

Results 1 to 2 of 2

Thread: ASP Insert Text

  1. #1
    Jason L. Guest

    Default ASP Insert Text

    I have a script which takes the content of a form, much like this one, and inserts it into an access db. If someone uses an apostrophe in their text, like "it&#039s", it causes all sorts of problems. Any ideas?<BR>SQL:<BR>INSERT INTO tablename (body) VALUES(&#039"& Request.form("body") &"&#039)"

  2. #2
    Nathen Grass Guest

    Default RE: ASP Insert Text

    Use the Replace function to replace the single apostrophe with a character that won&#039t cause any problems.<BR><BR>temp = Request.form("body")<BR>temp = Replace(temp,"&#039","~")<BR>INSERT INTO tablename (body) VALUES(&#039"& temp &"&#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