最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp生成xml文档实例程序代码
时间:2022-06-30 09:24:08 编辑:袖梨 来源:一聚教程网
xml部分:
------------------------------------------------------------------
asp教程部分:
-------------------------------------------------------------------
<%@language="vbscript" codepage="936"%>
<%
'建立数据库教程连接
set conn=server.createobject("adodb.connection")
dbpath = server.mappath("../##25gx##/#25gx#.mdb")
conn.open "provider=microsoft.jet.oledb.4.0; data source="&dbpath
'打开数据库表
exec="select * from wl_ad"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3'生成xml
xmlfile=server.mappath("../xml/bcastr.xml")
set fso = createobject("scripting.filesystemobject")
set myfile = fso.createtextfile(xmlfile,true)
myfile.writeline("")
myfile.writeline("") rs.movefirst '记录指针移至第一条记录上
while not rs.eof '当指针未到结尾时执行此循环
'myfile.writeline("- ")
myfile.writeline("- ")
' 输出到文件
rs.movenext '指针移至下一条记录
wend
rs.close
set rs = nothing
conn.close
set conn=nothingmyfile.writeline("")
myfile.close
%>