< !-- #include file="adoconn.asp" -- >
< !-- #include file="kktTemplate.asp" -- >
< %
'=========================================
'功能:网页与程序分离,并从数据库中读取数据
'作者:wangsdong
'来源:www.aspprogram.cn
'文章为作者原创,转载请注明文章出处、保留作
'者信息,谢谢支持!
'=========================================
dim my_color, kkt, myname, animal, plant
set kkt = new kktTemplate
kkt.set_file "hndKktTemp", "templeta/4.html"
sql="select * from news"
Set rs=conn.execute(sql)
If rs.eof Then
Else
kkt.set_block "hndKktTemp", "newsList", "a"
Do While Not rs.eof
kkt.set_var "title", rs("title"), False
kkt.set_var "id", rs("id"), false
kkt.parse "a", "newsList", true
rs.movenext
Loop
End If
rs.close
Set animal=nothing
kkt.parse "out", "hndKktTemp", false
kkt.p "out"
% >
源码下载地址: asp网页与程序分离