| 查看: 161 | 回复: 0 | |||
| 当前主题已经存档。 | |||
[交流]
用asp创建excel的例子【非常使用】
|
|||
Set fs = server.CreateObject("scripting.filesystemobject" '--假设你想让生成的EXCEL文件做如下的存放 filename = Server.MapPath("orderinfo.xls" '--如果原来的EXCEL文件存在的话删除它 if fs.FileExists(filename) then fs.DeleteFile(filename) end if '--创建EXCEL文件 set myfile = fs.CreateTextFile(filename,true) if rs.EOF and rs.BOF then else dim strLine,responsestr strLine="" For each x in rs.fields strLine= strLine & x.name & chr(9) Next '--将表的列名先写入EXCEL myfile.writeline strLine ‘rs为从数据库中读取数据的记录集 Do while Not rs.EOF strLine="" for each x in rs.Fields strLine= strLine & x.value & chr(9) next '--将表的数据写入EXCEL myfile.writeline strLine rs.MoveNext loop [ Last edited by 幻影无痕 on 2006-11-3 at 08:11 ] |
» 猜你喜欢
2026年面上项目中了,2A+B, 会评顺利通过
已经有12人回复
Suzuki偶联中硼酸酯原料掉下的硼酸酯是否可以自身偶联,生成B2Pin2杂质
已经有3人回复
大龄残疾硕士的一点执念
已经有19人回复
今年E04面上
已经有19人回复
刑法学论文投稿求助
已经有5人回复
Journal of Environmental Chemical Engineering
已经有3人回复
最后一年,祈求好运
已经有3人回复
风电环氧领域
已经有3人回复











回复此楼