Help with creating an excel file from a db

D

Dave

I do not get an error, but I also do not get any data in the excel file. I
know it is connecting to the db

<!--#include file="../db.asp"-->
<%

Response.ContentType = "application/vnd.ms-excel"
%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%
OpenDatabase dbc
set objrs = server.createobject("ADODB.Recordset")
SQL = "select * from title"
Set objrs=dbc.execute(SQL)
%>
<TABLE BORDER=1>
<TR>
<%
For i = 0 to objrs.fields.count - 1


%>
<TD><% = objrs(i).name %></TD>
<% next %>
</TR>
<%

while not objrs.eof
%>
<TR>
<% For i = 0 to objrs.fields.count - 1
%>
<TD VALIGN=TOP><% = objrs(i) %></TD>
<% Next %>

</TR>
<%
objrs.MoveNext

wend

%>

<body>

</body>
</html>
 
B

Bob Barrows

Dave said:
I do not get an error, but I also do not get any data in the excel
file. I know it is connecting to the db

<!--#include file="../db.asp"-->
<%

Response.ContentType = "application/vnd.ms-excel"
%>
If you remove the ContentType line, do you get the expected data in the
resulting page?

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,084
Latest member
HansGeorgi

Latest Threads

Top