Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP Page not opening a new Excel Spreadsheet each time.

Thread Tools

ASP Page not opening a new Excel Spreadsheet each time.

Posts: n/a
I have inhertited and old asp application that I have to make a few
changes to and I am having difficulties with a page that retrives data
from the database, and places it into an Excel spreadsheet. It seemed
to be working fine in the beginning, but not anymore. The only thing
that I know of that could be different is that I installed J2SE Runtime
Environment 5.0 Update 6. I have since uninstalled it just to see if
it makes any difference, which it did not.

How the page works, is that the user selects different fields to be
displayed as well as the criteria for the query. A select statement is
created and executed against the database. The page then loops though
the records returned creating a table. The Response.ContentType =

Sometimes it works the first time, but then if you go back, change the
selection criteria and/or fields to be displayed and submit the form
again, you get the same results as the last query. I have checked to
make sure that the query itself changes and it does.

Here is a sample of the code being used:

Set rs0 = Server.CreateObject("ADODB.Recordset") strsql, cn
If not rs0.BOF and not rs0.EOF then
Response.Buffer = True
Response.ContentType = "application/"
<META HTTP-EQUIV="no-cache">
<table border=0 cols=<%=rs0.Fields.Count%> ID="Table1">
<%for each oField in rs0.Fields%>
<%do while not rs0.EOF %>
<%for each oField in rs0.Fields%>
<td align=left>
<%if IsNull(oField) then
Response.Write "&nbsp;"
Response.Write (oField.Value)
end if%>
<%end if%>

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with opening Excel after opening Excel inside Microsoft Internet Controls fniles ASP General 0 04-26-2009 09:39 PM
opening up an excel spreadsheet in Robert Smith ASP .Net 1 04-23-2008 08:49 PM
ASP Page not opening a new Excel Spreadsheet each time. lds ASP .Net 2 01-04-2006 08:16 PM
Displaying an Excel spreadsheet in ASP page? Horhayson ASP General 3 02-02-2005 10:48 PM
Returning Excel Spreadsheet as web page =?Utf-8?B?S2VpdGhSYWdpbkZAbmV3c2dyb3Vwcy5ub3NwYW0=?= ASP .Net 10 05-06-2004 12:53 AM