I'm trying to use Response.ContentType to display an ASP page as a Word document. In the page, I'm trying to display data from an ADO recordset. The page DOES load as a Word document, but no values from the recordset show on the page.
(I know that the recordset does contain data, because if I comment out the line that sets the ContentType, the recordset values do get displayed in the ASP page.)
I hope someone can tell me why this doesn't work? Here is my code:
<%
Response.Buffer = TRUE
Response.ContentType = "application/msword"
dim rs
Set rs = server.CreateObject("ADODB.Recordset"
rs.Open "EXECUTE usp_GetGroup 8234", strConnection, adOpenStatic, adLockReadOnly
%>
<HTML>
<HEAD>
<TITLE>Test Page</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD><%=rs("groupName"
%></TD>
</TR>
<TR>
<TD><%=rs("firstName"
& " " & rs("lastName"
%></TD>
</TR>
</TABLE>
</BODY>
</HTML>
<%
rs.close()
set rs = nothing
%>
(I know that the recordset does contain data, because if I comment out the line that sets the ContentType, the recordset values do get displayed in the ASP page.)
I hope someone can tell me why this doesn't work? Here is my code:
<%
Response.Buffer = TRUE
Response.ContentType = "application/msword"
dim rs
Set rs = server.CreateObject("ADODB.Recordset"
rs.Open "EXECUTE usp_GetGroup 8234", strConnection, adOpenStatic, adLockReadOnly
%>
<HTML>
<HEAD>
<TITLE>Test Page</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD><%=rs("groupName"
</TR>
<TR>
<TD><%=rs("firstName"
</TR>
</TABLE>
</BODY>
</HTML>
<%
rs.close()
set rs = nothing
%>