<% Response.Buffer = true Response.ContentType = "text/xml" Function applySpecialFormat(strInput) if len(strInput) > 0 then strInput = Replace(strInput,"&", "&") strInput = Replace(strInput,"'", "& apos;") 'REMOVE SPACE BETWEEN & apos; strInput = Replace(strInput,"""", "& quot;") 'REMOVE SPACE BETWEEN & quot; strInput = Replace(strInput, ">", "& gt;") 'REMOVE SPACE BETWEEN & gt; strInput = Replace(strInput,"<","& lt;") 'REMOVE SPACE BETWEEN & lt; else strInput = "" end if applySpecialFormat = strInput End Function %>
RSS โดยใช้รหัส ASP //www.myserver.com RSS ใช้รหัส ASP เพื่อดูบทความใหม่และที่มีอยู่จากฐานข้อมูล en-US ลิขสิทธิ์ 2006
20
//www.myserver.com/images/logo.jpg RSS โดยใช้โลโก้รหัส ASP //www.myserver.com
<% Dim objConn Set objConn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.Recordset") objConn.ConnectionString = "Provider=sqloledb;Data Source=DBSERVER;Initial Catalog=ARTICLEDB;User Id=sa;Password=sqlpassword;" objConn.CursorLocation = 3 objConn.Open
Dim objRS, strSQL, strDesc strSQL = "SELECT * FROM ArticleDB WHERE (AddedDate <= '" & Now() & "') order by AddedDate DESC" objRS.Open strSQL, objConn
Do While Not objRS.EOF strDesc = "Article by " & objRS("AddedBy") & " on " & _ objRS("AddedDate") & " PST " & _ objRS("ArticleContent").Value %>