text file

G

Gary

Hello,
I am using asp classical and connection to SQL 2000 on a Windows 2000
machine.
I am using this code to generate a text file when the user clicks on the
link. This is so the user can download the file on an as needed basis.
DIM filename
filename = "Companies.txt"
Response.ContentType = "Unknown"
Response.AddHeader "content-disposition", "attachment;filename=""" &
filename & """"

The issue I am having is if the text file is less than approx. 1 mb then the
file downloads fine. If the file is bigger than that I get this error:
"Internet Explorer cannot download <the name of the asp page> from <the name
of the website> Internet Explorer was not able to open this internet site.
The requested site is either unavailable or cannot be found. Please try
again later."

I get my data here:
DIM rs, strSQL
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = adUseClient
strSql = "stored procedure" & param1 & "," & param2
rs.Open strSql ,objConn ,adOpenForwardOnly ,adLockReadOnly ,adCmdtext

I then write it to a text file like this:

<%
Response.Write "CompanyName" & "|"
if not rs.BOF and not rs.EOF then
rs.MoveFirst
Do until rs.EOF
Response.Write rs.fields("Company_Name")& "|"
rs.MoveNext
Loop
end if
rs.Close
Set rs= nothing
%>

There are many more fields that are being returned but to keep it short I
only included one so you could see the layout of my code.

If someone could help me I would appreciate it.
If you need more information please let me know.

Thanks Gary
 
R

Ray Costanzo [MVP]

If you comment out the part that prompts this to be a file download and just
let everything response.write out normally, what do you get?

Ray at home
 
G

Gary

Ray, thanks for the reply.
I commented out the item you sugested and I get the following error.
"Response Buffer Limit Exceeded"

"Execution of the ASP page caused the Response Buffer to exceed its
configured limit."

is there any way to get around this limit?

How do I configure the Response Buffer Limit?



Thanks



Gary
 
B

Bob Barrows [MVP]

Gary said:
Ray, thanks for the reply.
I commented out the item you sugested and I get the following error.
"Response Buffer Limit Exceeded"

"Execution of the ASP page caused the Response Buffer to exceed its
configured limit."

is there any way to get around this limit?

How do I configure the Response Buffer Limit?
Turn off buffering for the page?

Response.buffer = false

Bob Barrows
 
R

Roland Hall

in message
: Gary wrote:
: > Ray, thanks for the reply.
: > I commented out the item you sugested and I get the following error.
: > "Response Buffer Limit Exceeded"
: >
: > "Execution of the ASP page caused the Response Buffer to exceed its
: > configured limit."
: >
: > is there any way to get around this limit?
: >
: > How do I configure the Response Buffer Limit?
: >
: >
: >
: Turn off buffering for the page?
:
: Response.buffer = false

Interesting. My download routine has buffering on and I just tested
downloading a 2Mb file and it worked fine. Also, I missed the part where
the OP wrote the text to the file. I only see it written to the screen.
Could that be the issue for the buffer depletion?
My download routine is a little more complex that what it shown here as this
appears to not be complete but I don't think the download itself is the
issue.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 

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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top