1,新建一个xls文件,xxx.xls
2,xxx.asp
<!--#include file="../weblaw.inc"-->
<!--#include file="../adovbs.inc"-->
<!--#include file="../connection.inc"-->
<!--#include file="../style.inc"-->
<!--#include file="../include/script.inc"-->
<!--#include file="../include/other.inc"-->
<!--#include file="../Include/right.inc"-->
<%
Server.ScriptTimeOut =1000
'on error resume next
excelid=session("user")&year(date)&second(time)&".xls"
'response.write excelid
'abill = Split(Request("BillID")&",", ",")
if request("excelstrSQL") <> "" then
strSQL = request("excelstrSQL")
else
strSQL = "1=0"
end if
strSelectSQL = "1=1"
if FuncRight("DT_0002") = 1 then
elseif FuncRight("DT_0007") = 1 then
strSelectSQL = strSelectSQL & " and cl_area = ( select emp_

这篇博客介绍了如何使用ASP从数据库中获取数据,并通过模板写入到Excel文件中,包括设置Excel工作簿、工作表,以及将数据库记录写入到Excel表格的各个单元格内。最后,还展示了如何保存生成的Excel文件并提供下载链接。
最低0.47元/天 解锁文章
1948

被折叠的 条评论
为什么被折叠?



