当前位置:编程学习 > asp >>

asp程序与网页分离

< !-- #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教程,ASP入门
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,