ASP SQL数据库导出到excel
编写了一个asp 文件,将SQL数据库导出到excel,如果选择有条件筛选,可以正常导出,但是如果不选择筛选,想把数据库全部导出,数据大概24000条左右,提示如下图,请问问题在哪里?程序如何修改?谢谢,急等

<!-- #include file="../inc/key.asp" -->
<!-- #include file="../inc/conn.asp" -->
<%
nowfilename=replace(replace(replace(now,":","")," ",""),"/","")
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "inline; filename = "&nowfilename&".xls"
%>
<html>
<head>
</head>
<body>
<%
'取得搜索关键字
nowsearch1=request("search1")
nowkeyword1=request("keyword1")
nowsearch2=request("search2")
nowkeyword2=request("keyword2")
set rs_clsb =server.createobject("ADODB.RecordSet")
sql_clsb="select * from clsbtz"
if nowsearch1<>"" and nowkeyword1<>"" then
if nowsearch2<>"" and nowkeyword2<>"" then
sql_clsb=sql_clsb&" where "&nowsearch1&" like '%"&nowkeyword1&"%' and "&nowsearch2&" like '%"&nowkeyword2&"%'"
else
sql_clsb=sql_clsb&" where "&nowsearch1&" like '%"&nowkeyword1&"%'"
end if
else
if nowsearch2<>"" and nowkeyword2<>"" then
sql_clsb=sql_clsb&" where "&nowsearch2&" like '%"&nowkeyword2&"%'"
end if
end if
if request("order1")<>"" then
sql_clsb=sql_clsb&" order by zylb "&request("order1")
elseif request("order2")<>"" then
sql_clsb=sql_clsb&" order by clsbmc "&request("order2")
elseif request("order3")<>"" then
sql_clsb=sql_clsb&" order by xhgg "&request("order3")
elseif request("order4")<>"" then
sql_clsb=sql_clsb&" order by clfw "&request("order4")
elseif request("order5")<>"" then
sql_clsb=sql_clsb&" order by zqd "&request("order5")
elseif request("order6")<>"" then
sql_clsb=sql_clsb&" order by sccj"&request("order6")
elseif request("order7")<>"" then
sql_clsb=sql_clsb&" order by sbbh "&request("order7")
else
sql_clsb=sql_clsb
end if
rs_clsb.open sql_clsb,conn,1,1
%>
<table width="100%" border="1" align="center" cellpadding="2" cellspacing="0">
<tr>
<th>序号</th>
<th>专业类别</th>
<th>测量设备种类</th>
<th>测量设备名称</th>
<th>型号规格</th>
<th>测量范围</th>
<th>准确度</th>
<th>制造厂商</th>
<th>设备编号</th>
<th>附件</th>
<th>使用部门</th>
<th>使用地点</th>
<th>使用人</th>
<th>设备领取日期</th>
<th>检定方式</th>
<th>检定部门</th>
<th>检定周期</th>
<th>检定月份</th>
<th>ABC</th>
<th>检定日期</th>
<th>有效日期</th>
<th>证书报告号</th>
<th>设备状态</th>
</tr>
<%
i=0
do while rs_clsb.eof=false
i=i+1
%>
<tr>
<td align="center"><%=i%></td>
<td align="center"><%="'"&rs_clsb("zylb")%></td>
<td align="center"><%="'"&rs_clsb("clsbzl")%></td>
<td align="center"><%="'"&rs_clsb("clsbmc")%></td>
<td align="center"><%="'"&rs_clsb("xhgg")%></td>
<td align="center"><%="'"&rs_clsb("clfw")%></td>
<td align="center"><%="'"&rs_clsb("zqd")%></td>
<td align="center"><%="'"&rs_clsb("sccj")%></td>
<td align="center"><%="'"&rs_clsb("sbbh")%></td>
<td align="center"><%="'"&rs_clsb("fj")%></td>
<td align="center"><%="'"&rs_clsb("sybm")%></td>
<td align="center"><%="'"&rs_clsb("sydd")%></td>
<td align="center"><%="'"&rs_clsb("syr")%></td>
<td align="center"><%=rs_clsb("sblqrq")%></td>
<td align="center"><%="'"&rs_clsb("jdfs")%></td>
<td align="center"><%="'"&rs_clsb("jdbm")%></td>
<td align="center"><%="'"&rs_clsb("jdzq")%></td>
<td align="center"><%="'"&rs_clsb("jdyf")%></td>
<td align="center"><%="'"&rs_clsb("abc")%></td>
<td align="center"><%=rs_clsb("jdrq")%></td>
<td align="center"><%=rs_clsb("yxrq")%></td>
<td align="center"><%="'"&rs_clsb("zsh")%></td>
<td align="center"><%="'"&rs_clsb("sbzt")%></td>
</tr>
<%
rs_clsb.movenext
loop
%>
</table>
</body>
</html>
相关推荐
asp.net导入导出excel表,导入到sql数据库
采用DataTable和DataGrid两种导出方式,导出格式默认为xls,可以自行更改后缀。 导入采用直接把数据导入到数据库的方式。
ASP.NET Excel数据处理:导出到表格与导入SQL数据库
EPPlus是一个流行的.NET库,用于读取和写入Excel文件。它与旧版的Excel(.xls)和新版本的Excel(.xlsx)格式兼容。EPPlus的主要优势包括:内存效率:EPPlus在内存中以压缩格式处理Excel文件,减少内存占用。性能:对于大文件的读取和写入操作,EPPlus比其他一些库更快。易于使用:提供了简洁的API,使开发者可以轻松完成复杂的任务。功能丰富:支持复杂格式、图表、公式等。
ASP导出Excel数据的四种方法
ASP导出Excel数据的四种方法,网上搜索,共同分享。
asp 数据库导出到excel源码
asp 将数据库access或sql及mysql查询的数据导出到excel,已经把相关文件全部打包,放到站点上就可以测试。确保能用。本人已经应用!
asp利用sql进行筛选导出excel
此例子通过sql筛选出想要导出的数据,不用创建excel对象,避免创建excel对象时的错误,已成功用于本人网站案例,大家可以放心下载。


