Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.dotnet.framework.aspnet,microsoft.public.excel.programming,microsoft.public.dotnet.framework.aspnet,microsoft.public.inetserver.asp
lds lds is offline
external usenet poster
 
Posts: 4
Default ASP Page not opening a new Excel Spreadsheet each time.

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 =
"application/vnd.ms-excel"

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")
rs0.open strsql, cn
If not rs0.BOF and not rs0.EOF then
Response.Clear
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
rs0.MoveFirst%
<HTML
<HEAD
<META HTTP-EQUIV="no-cache"
</HEAD
<BODY
<p&nbsp;
<table border=0 cols=<%=rs0.Fields.Count% ID="Table1"
<tr
<%for each oField in rs0.Fields%
<th<%=oField.name%</th
<%next%
</tr
<%do while not rs0.EOF %
<tr
<%for each oField in rs0.Fields%
<td align=left
<%if IsNull(oField) then
Response.Write "&nbsp;"
else
Response.Write (oField.Value)
end if%
</td
<%next
rs0.MoveNext
%
</tr
<%loop%
</table
<%end if%
</BODY
</HTML

  #2   Report Post  
Posted to microsoft.public.dotnet.framework.aspnet,microsoft.public.excel.programming,microsoft.public.dotnet.framework.aspnet,microsoft.public.inetserver.asp
lds lds is offline
external usenet poster
 
Posts: 4
Default ASP Page not opening a new Excel Spreadsheet each time.

I just thought that I would add that this has started working for me
again. The only thing I did was delete my recent documents and files
in my temp directory. I guess I just need to figure out why there was
a copy there to begin with...

  #3   Report Post  
Posted to microsoft.public.dotnet.framework.aspnet,microsoft.public.excel.programming,microsoft.public.dotnet.framework.aspnet,microsoft.public.inetserver.asp
lds lds is offline
external usenet poster
 
Posts: 4
Default ASP Page not opening a new Excel Spreadsheet each time.

I just thought that I would add that this has started working for me
again. The only thing I did was delete my recent documents and files
in my temp directory. I guess I just need to figure out why there was
a copy there to begin with...

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening workbook on the same page every time Klee Excel Worksheet Functions 7 March 5th 10 09:56 PM
How do I print a one page spreadsheet multiple time, each with i. oshrat Excel Worksheet Functions 3 December 31st 09 05:37 PM
Can print just 1 page from a 2 page of excel spreadsheet Ellie Augur New Users to Excel 1 August 6th 09 04:40 PM
opening a new page with hyperlinks in excel wassupdoc000 Excel Discussion (Misc queries) 3 June 30th 07 02:20 AM
How do I print a one page spreadsheet multiple time, each with its own page number? lhsallwasser Excel Discussion (Misc queries) 4 August 17th 05 03:00 PM


All times are GMT +1. The time now is 03:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"