Let me preface this post with the fact that I know very little about ASP programming so please go easy on me.
I have a Text/HTML module for an announcment section in a newsletter that we send via a third party. I am having trouble converting the encoded text which is stored in the HtmlText database. We have set up a Text/HTML module for the clients to enter their announcement text in - as I understand it the content from the module is converted (encoded) upon insertion into the HtmlText database for security reasons thereby converting the brackets, quotes etc. into different characters. As a result when I pull the data from db the text displays as the code. The following test content displays as follows (the actual code instead of html):
This is a test announcement.
This is a test link.
 
which displays literally as:
This is a test announcement.
This is a test link.
I found a function to convert the code back (decode) but it is not working. Here is the code that I am attempting to use:
<%<br> DIM sql2<br> sql2 = "SELECT DesktopHtml FROM HtmlText WHERE ModuleID = 'x'"<br><br> DIM objRS2<br> Set objRS2 = Server.CreateObject("ADODB.Recordset")<br> objRS2.Open sql2, objConn<br> %>
<%<br> Dim sText<br> Set sText= objRS2("DesktopHTML")<br> %>
<%<br> Function HTMLDecode(sText)<br> Dim I<br> sText = Replace(sText, """, Chr(34))<br> sText = Replace(sText, "<" , Chr(60))<br> sText = Replace(sText, ">" , Chr(62))<br> sText = Replace(sText, "&" , Chr(38))<br> sText = Replace(sText, " ", Chr(32))<br> For I = 1 to 255<br> sText = Replace(sText, "&#" & I & ";", Chr(I))<br> Next<br> HTMLDecode = sText<br> End Function<br> %>
<% Response.Write(sText) %>
Any assistance with this issue is greatly appreciated.
Travis