Response.ContentType="text/xml"
dim?db,dbpath,conn
dim?rs,SQL
db="shujuku/hotltcom.mdb"''''這里填寫你的數據庫地址
Set?conn?=?Server.CreateObject("ADODB.Connection")
dbpath="Provider=Microsoft.Jet.OLEDB.4.0;Data?Source="?&?Server.MapPath(db)
conn.Open?dbpath
%>
'這里是xml的版本和語言聲明
'以下相當于html的meta部分,包括標題.連接.語言.版權信息以及logo圖標等
簡單的快樂
http://siyizhu.com
簡單的快樂
zh-cn
Copyright?2006?hotlt
[email protected]
簡單的快樂?
http://siyizhu.com/logo.gif?
http://siyizhu.com/siyizhu's?weblog
'以下是連接數據庫數據表部分,top?15代表最新的15條,movie是數據表
SQL="select?top?15?*?from?movie?order?by?id?desc"
set?rs=conn.execute(SQL)
if?rs.Eof?or?rs.Bof?then
response.write?" "
end?if
while?not?rs.Eof?
Title=rs("Title")'這里定義Title是標題,("Title")為字段名稱
id=rs("id")'這里定義id是連接id?,("id")為字段名稱
Time=rs("Time")'這里定義Time是時間?,("Time")為字段名稱
Content=replace(replace(left(rs("Content"),200),"",">")'這里的Content是內容的字段名稱
'以下是rss輸出
response.Write?"- "
Response.write?""&Title&""?'這里是輸出標題
response.write?"http://siyizhu.com/weblog/article.asp?ID="&id&""?'這里是輸出鏈接,注意要用網址
response.write?"siyizhu"?'這里是輸出作者,如果有字段可以調用字段
response.write?""&Time&""?'這里是時間
response.write?""'這里是輸出簡介,因為可能有代碼.括起來,否則預覽時會提示錯誤。
response.write?" "
rs.MoveNext?
wend?
set?rs=nothing
conn.Close
set?conn?=?nothing
%>