| 查看: 149 | 回复: 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 ] |
» 猜你喜欢
282求调剂
已经有5人回复
诚招农业博士
已经有3人回复
材料学硕318求调剂
已经有9人回复
338求调剂
已经有3人回复
材料与化工328求调剂
已经有3人回复
289求调剂
已经有3人回复
化工270求调剂
已经有8人回复
一志愿山东大学材料与化工325求调剂
已经有3人回复
291 求调剂
已经有3人回复
0805总分292,求调剂
已经有8人回复













回复此楼