| 查看: 143 | 回复: 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 ] |
» 猜你喜欢
拟解决的关键科学问题还要不要写
已经有6人回复
基金申报
已经有6人回复
存款400万可以在学校里躺平吗
已经有6人回复
推荐一本书
已经有13人回复
基金委咋了?2026年的指南还没有出来?
已经有9人回复
国自然申请面上模板最新2026版出了吗?
已经有17人回复
纳米粒子粒径的测量
已经有8人回复
疑惑?
已经有5人回复
计算机、0854电子信息(085401-058412)调剂
已经有5人回复
Materials Today Chemistry审稿周期
已经有5人回复











回复此楼