asp生成xml文件

												
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include file = "../manage.asp"-->
<!--#include file="../include/ado.asp"-->
<html>
<head>
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="/style.css" rel="stylesheet" type="text/css">
<script language=javascript src="/include/wpCalendar.js"></script>
<script>

</script>
</head>
<body>
<%
	dtime= DateDiff("s",cdate("1970-1-1 00:00:00"),now()) '获取当前时间和1970年1月1日间的秒数
    Dim rs,sql
    Set rs = server.CreateObject("adodb.recordset")

	    sql = " select a.phone,b.mode,c.sectionno, case when a.last4 = 1 then '不含4' when a.last4 = 2 then '含4' else '全部' end last, d.name ckName, case when a.isSended = 1 then '已分配' else '未分配' end issended, case when a.isOpen = 1 then '已开通' else '未开通' end  isopen, a.id from gc_goodPhone a, gc_numberMode b, gc_sectionno c, gc_ck d where a.modeid = b.id and a.sectionnoid = c.id and a.unitid = "&session("unitid")&" and a.ck_id = d.id "

		rs.open sql, conn, 1, 2
         i = 1
		xmlfile=server.mappath(dtime&".xml")
		Set fso = CreateObject("Scripting.FileSystemObject")
		Set MyFile = fso.CreateTextFile(xmlfile,True)
		MyFile.WriteLine("<chart caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' showValues='0' decimals='0' formatNumberScale='0'>")

		 If rs.recordcount > 0 Then
		   For i= 1 To rs.RecordCount
			 If Not rs.eof Then

			MyFile.WriteLine("  <set label='Jan"&i&"' value='462'/>")

	       End If 
		   If Not rs.eof Then
		      rs.movenext
		   End If 
		 Next
		End If 

		MyFile.WriteLine("</chart>")
		MyFile.Close
%>
</body>
</html>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值