| 查看: 148 | 回复: 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 ] |
» 猜你喜欢
材料类求调剂
已经有14人回复
322求调剂
已经有3人回复
0856材料与化工,270求调剂
已经有7人回复
材料复试调剂
已经有5人回复
085600 英一数二272求调剂
已经有7人回复
哈工大计算机刘劼团队招生
已经有5人回复
高分子化学与物理调剂
已经有13人回复
0854复试调剂 276
已经有5人回复
欢迎采矿、地质、岩土、计算机、人工智能等专业的同学报考
已经有6人回复
0857调剂
已经有5人回复













回复此楼
10