Results 1 to 3 of 3

Thread: Storing HTML in an SQL Database

  1. #1
    mark Guest

    Storing HTML in an SQL Database


    Anybody have a clue how to store HTML in an SQL database?
    I get errors trying to put the HTML text into a text datatype field....

    Please send replies via email.

    mark@ntshop.net

  2. #2
    Tim Brooks Guest

    Storing HTML in an SQL Database (reply)

    Mark,

    Just store it in the db as HTML--SQL doesn't care what the data is right?

    Then, when you want to out put it into your page use the HTMLEncode command:

    <%
    &#39;From your recordset
    myHTML = RS(&#34;theHTML&#34
    %>
    This is HTML output <%=Server.HTMLEncode(myHTML)%>


    Hope this helps...
    Tim


    ------------
    mark at 6/26/99 12:39:04 PM


    Anybody have a clue how to store HTML in an SQL database?
    I get errors trying to put the HTML text into a text datatype field....

    Please send replies via email.

    mark@ntshop.net

  3. #3
    Tim Guest

    Storing HTML in an SQL Database (reply)

    I really don&#39;t see why you would do so, but I insert HTML all the time in memo fields for guest books in Access.. Make sure your insert statment use&#39;s the replace function if your inserting into the database from ASP.. If someone insert&#39;s &#34;Mc&#39;Guinn&#34; for instance, this can mess up your query.. Don&#39;t know if that&#39;s what you mean, but otherwise the database shouldn&#39;t care what type of text you store


    ------------
    Tim Brooks at 10/1/99 9:19:05 AM

    Mark,

    Just store it in the db as HTML--SQL doesn&#39;t care what the data is right?

    Then, when you want to out put it into your page use the HTMLEncode command:

    <%
    &#39;From your recordset
    myHTML = RS(&#34;theHTML&#34
    %>
    This is HTML output <%=Server.HTMLEncode(myHTML)%>


    Hope this helps...
    Tim


    ------------
    mark at 6/26/99 12:39:04 PM


    Anybody have a clue how to store HTML in an SQL database?
    I get errors trying to put the HTML text into a text datatype field....

    Please send replies via email.

    mark@ntshop.net

Posting Permissions

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