28,390
社区成员
发帖
与我相关
我的任务
分享
Set fs = server.CreateObject("scripting.filesystemobject")
filename="stock_list.xls"
temp=filename
filename=server.MapPath("excel\")+filename
'--创建EXCEL文件
set myfile = fs.CreateTextFile(filename,true)
dim strLine,responsestr
strLine=""
For each x in rs.fields
strLine= strLine & x.name & chr(9)
Next
'--将表的列名先写入EXCEL
myfile.writeline strLine
while not rs.eof
strLine=""
for each x in rs.Fields
strLine= strLine & x.value & chr(9)
next
'--将表的数据写入EXCEL
myfile.writeline strLine
rs.movenext
wend
response.redirect "excel/stock_list.xls"
set myfile = nothing
Set fs=Nothing
end if