ASP+ACCESS导出到EXCEL无显示数据,请帮忙
我页面的主要代码如下,页面正常显示数据集,可导出到EXCEL时只有表头表尾<TABLE>不显示<!--#include file="../../Connections/connRoot.asp" -->
<%
Dim Rec1__MMColParam
Rec1__MMColParam = "1"
If (Request.QueryString("activityID") <> "") Then
Rec1__MMColParam = Request.QueryString("activityID")
End If
%>
<%
Dim Rs_enr
Dim Rs_enr_numRows
Set Rs_enr = Server.CreateObject("ADODB.Recordset")
Rs_enr.ActiveConnection = MM_conn_STRING
Rs_enr.Source="select activity.activityID,activity.activityName,enrollmentID,member.userID,userName,userpartDepartment,enrollmentTime,userTelephone,enrollmentMemo,isparticipate from activity,enrollment,member where activity.activityID=enrollment.activityID and enrollment.userID=member.userID and activity.activityID='" + Replace(Rec1__MMColParam, "'", "''") + "' ORDER BY enrollment.enrollmentTime DESC"
Rs_enr.CursorType = 0
Rs_enr.CursorLocation = 2
Rs_enr.LockType = 1
Rs_enr.Open()
Rs_enr_numRows = 0
%>
…… ……
<body>
<div align="center">
<br>
<table width="98%" border="0" cellpadding="5" cellspacing="1" bgcolor="#999999">
<tr>
<td align="center" height="23" bgcolor="#0377BC"><span class="STYLE1"><font color="#FFFFFF">活动详细记录</font></span></td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF"><br>
<form name="form1" method="post" >
<%if request("post")<>"" then
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "attachment; fileName=报名记录单.xls"
end if%>
<table width="98%" border="0" cellpadding="5" cellspacing="1" bgcolor="#999999" id="table1" style="border-collapse: collapse">
…… ……
</table>
<%if request("post")<>"" then response.End() end if%>
<div align="center"><br>
<input type="submit" name="Submit" value="导出到Excel" onClick="window.open('activity_enrollMg.asp?post=true')">
</div>
</form>
<br /></td></tr>
</table>
</div>
</body>
说明:类似的代码我在SQL数据库用过,不知道是不是因为ACCESS数据库的限制还是这代码里的其他问题,请指教,感激不尽!