Page is a not externally linkable
- Code, Content, and Presentation
-- RSS, ATOM, and Related Technologies
---- RSS From Access Database


dukelips - 10:36 am on Mar 2, 2010 (gmt 0)


<?xml version="1.0" encoding="ISO-8859-1"?>
<% Response.Buffer = true
Response.ContentType = "text/xml"



Function ApplyXMLFormatting(strInput)
strInput = Replace(strInput,"&", "&amp;")
strInput = Replace(strInput,"'", "'")
strInput = Replace(strInput,"""", "&quot;")
strInput = Replace(strInput, ">", "&gt;")
strInput = Replace(strInput,"<","&lt;")

ApplyXMLFormatting = strInput
End Function
%>

<rss version="2.0">
<channel>
<title></title>
<link></link>
<description></description>
<language>en-us</language>
<copyright>All Rights Reserved.</copyright>
<lastBuildDate><%=Now()%></lastBuildDate>
<ttl>20</ttl>
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = Application("forum_system_dsn")
objConn.Open

Dim objRS, strSQL, strDesc
strSQL = "sp_GetTop25Posts"
Set objRS = objConn.Execute(strSQL)

Do While Not objRS.EOF
strDesc = "<b>Message by " & objRS("MsgAuthor") & " on " & _
objRS("MsgDate") & " EST</b><br>" & _
objRS("MsgResponse").Value %>
<item>
<title><%=ApplyXMLFormatting(objRS("MsgTitle").Value)%>
(<%=ApplyXMLFormatting(objRS("MsgAuthor").Value)%>)
</title>
<link>http://www.aspmessageboard.com/forum/showMessage.asp?F=
<%=objRS("ForumID")%>&amp;P=1&amp;M=<%=objRS("MsgID")%></link>
<description><%=ApplyXMLFormatting(strDesc)%></description>
<datePosted><%=ApplyXMLFormatting(objRS("MsgDate"))%></datePosted>
</item>
<%
objRS.MoveNext
Loop

objRS.Close
Set objRS = Nothing

objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>
</channel>
</rss>


Thread source:: http://www.webmasterworld.com/rss_atom/4088947.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com