ASP 怎么把从数据库中读出的数据列表批量导出为excel文件
1个回答
展开全部
输出的页面顶部加上代码
Server.ScriptTimeOut=99999999
response.ContentType ="application/vnd.ms-excel"
response.addheader "Content-Disposition","attachment;filename=汇总表.xls"
<%
sql="select * from 表"
set rs=conn.execute(sql)
if not rs.eof then
do while not rs.eof
response.write(rs("字段名"))
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
Server.ScriptTimeOut=99999999
response.ContentType ="application/vnd.ms-excel"
response.addheader "Content-Disposition","attachment;filename=汇总表.xls"
<%
sql="select * from 表"
set rs=conn.execute(sql)
if not rs.eof then
do while not rs.eof
response.write(rs("字段名"))
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询