473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

recordset data getting truncted during response.write

I have an ASP app that we've moved from a Windows 2000 to a Windows
2003 server (sql server 2000 to sql server 2005). The job runs fine on
the old servers.

Part of the app takes a recordset and response.writes out comma
delimited strings so that the results are opened in Excel or saved to a
flat file.

Basically, it looks something like this like this:

Response.AddHeader
"Content-Disposition","attachment;filename=Report.csv"
Call WriteHeader() ' Write out the headers for the columns below
For i = 1 to Ubound(arrRS, 2)

Response.write """" & arrRS(arrPONumber, i) & """" & ","
Response.write arrRS(arrRevNumber, i) & ","
Response.write """" & arrRS(arrPOStatusDesc, i) & """" & ","
Response.write """" & arrRS(arrLicName, i) & """" & ","
Response.write arrRS(arrOrderDateStamp, i) & ","
Response.write arrRS(arrOrderDate, i) & ","
Response.write arrRS(arrBuyCycleStamp, i) & ","
Response.write arrRS(arrShipDate, i) & ","
Response.write arrRS(arrConfShipDate, i) & ","
Response.write arrRS(arrCurrShipDate, i) & ","
Response.write arrRS(arrSD, i) & ","
Response.write vbCrLf
Next

When we moved it over to the new servers, the job started to have
problems. If I run the underlying sproc in sQL Server,
it returns about 17K records. If I run it in the ASP app, it only pulls
back about 2K records and the header section at the top is missing.

When I run it in the ASP page, I seem to only get the last X number of
records. It's like it sends out the first large chunk of records,
throws them away and then displays what's remaining.

If I changed the job to only show records 1 - 10000, it's fine.

If I change it to show records 1 - 10718, it's fine.

If I show 1 - 10719 records it craps out and only shows 2 rows of data
and no header.

If I show 1000 - 11718, it's fine.

I commented out all columns and started adding them back in, but I
can't identify a single column that's causing the problems.

I've cached the Responses and used Response.flush.

I changed the timeout on the IIS server to 900 (same as the old server)
with no love. I don't see any information indicating a maximum amount
of bytes that can be sent anywhere.

What the heck?? Any other ideas you might have would be appreciated.

Jan 22 '07 #1
4 4308
cb*********@gmail.com wrote:
I have an ASP app that we've moved from a Windows 2000 to a Windows
2003 server (sql server 2000 to sql server 2005). The job runs fine on
the old servers.

Part of the app takes a recordset and response.writes out comma
delimited strings so that the results are opened in Excel or saved to
a flat file.

Basically, it looks something like this like this:

Response.AddHeader
"Content-Disposition","attachment;filename=Report.csv"
Call WriteHeader() ' Write out the headers for the columns below
For i = 1 to Ubound(arrRS, 2)

Response.write """" & arrRS(arrPONumber, i) & """" & ","
Response.write arrRS(arrRevNumber, i) & ","
Response.write """" & arrRS(arrPOStatusDesc, i) & """" & ","
Response.write """" & arrRS(arrLicName, i) & """" & ","
Response.write arrRS(arrOrderDateStamp, i) & ","
Response.write arrRS(arrOrderDate, i) & ","
Response.write arrRS(arrBuyCycleStamp, i) & ","
Response.write arrRS(arrShipDate, i) & ","
Response.write arrRS(arrConfShipDate, i) & ","
Response.write arrRS(arrCurrShipDate, i) & ","
Response.write arrRS(arrSD, i) & ","
Response.write vbCrLf
Next

When we moved it over to the new servers, the job started to have
problems. If I run the underlying sproc in sQL Server,
it returns about 17K records. If I run it in the ASP app, it only
pulls back about 2K records and the header section at the top is
missing.

When I run it in the ASP page, I seem to only get the last X number of
records. It's like it sends out the first large chunk of records,
throws them away and then displays what's remaining.

If I changed the job to only show records 1 - 10000, it's fine.

If I change it to show records 1 - 10718, it's fine.

If I show 1 - 10719 records it craps out and only shows 2 rows of data
and no header.

If I show 1000 - 11718, it's fine.

I commented out all columns and started adding them back in, but I
can't identify a single column that's causing the problems.

I've cached the Responses and used Response.flush.

I changed the timeout on the IIS server to 900 (same as the old
server) with no love. I don't see any information indicating a
maximum amount of bytes that can be sent anywhere.

What the heck?? Any other ideas you might have would be appreciated.
I assume you've verified via Response.Write Ubound(arrRS, 2)
that the array (I assume you are generating it via GetRows) contains the
expected number of records.

I would use fso to write this data to a file on the server so you can
get some clues from it. You might want to consider streaming the file to
response instead of directly writing the data to Response.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jan 22 '07 #2
Hi Bob:

Bob Barrows [MVP] wrote:
I assume you've verified via Response.Write Ubound(arrRS, 2)
that the array (I assume you are generating it via GetRows) contains the
expected number of records.
Yes, I'm using GetRows, and the array does contain the proper number of
records.
I would use fso to write this data to a file on the server so you can
get some clues from it. You might want to consider streaming the file to
response instead of directly writing the data to Response.
I did this and the file created looks fine. Is there some kind of
limitation on the Response.Write method and IIS6? Why would this work
on the old server and not the new?

I'll try the streaming bit and let you know if that works.

Thanks!

Chris

Jan 23 '07 #3
cb*********@gmail.com wrote:
Hi Bob:

Bob Barrows [MVP] wrote:
>I assume you've verified via Response.Write Ubound(arrRS, 2)
that the array (I assume you are generating it via GetRows) contains
the expected number of records.

Yes, I'm using GetRows, and the array does contain the proper number
of records.
>I would use fso to write this data to a file on the server so you can
get some clues from it. You might want to consider streaming the
file to response instead of directly writing the data to Response.

I did this and the file created looks fine.
So we've successfully eliminated data corruption. I suppose you've tried
browsing to the file you created to ensure that you can at least do
that.
Is there some kind of
limitation on the Response.Write method and IIS6?
None that I know of. There IS a limit on the size of the Request that
can be adjusted, but I've never seen a limit on the size of the
Response.
Why would this work
on the old server and not the new?
Got me. Sorry.
>
I'll try the streaming bit and let you know if that works.
Good luck.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jan 23 '07 #4
cb*********@gmail.com wrote:
I did this and the file created looks fine. Is there some kind
of limitation on the Response.Write method and IIS6?
There *is* a metabase value AspBufferingLimit that could be the culprit, but
it seems to me you should get the "response buffer limit exceeded" exception
rather than a truncated table.

Since you appear to get all of the data, try flushing the buffer with each
pass through the recordset:
Response.write arrRS(arrSD, i) & ","
Response.write vbCrLf
Response.Flush ' <--- Right here ---
Next


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Jan 25 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andie | last post by:
Hello All, How would I go about using a disconnect recordset and select (x) records from it, x being the number of records to be selected. Many thanks in advance. -- Andie
1
by: Anand | last post by:
Hi i am having trouble adding a recordset into the access database, the code seems to be working fine it passs and parses through all variables just fine without showing any errors and also when i...
4
by: Eli Sidwell | last post by:
Trying to return a Recordset to an ASP and the Recordset is empty. The StorredProc works in the query analyzer and it even works from a quick VB app that I wrote to test it. The storedproc that...
1
by: Andrew Banks | last post by:
I've been handed an ASP project and having worked on .NET for the past year I have completely forgotten what to do. I am querying a SQL server DB and returning XML. The following code seems to...
8
by: dmiller23462 | last post by:
My brain is nuked....Can anybody tell me right off the bat what is wrong with this code? Along with any glaring errors, please let me know the syntax to display a message (Response.Write would be...
9
by: Johnfli | last post by:
ADODB.Recordset error '800a0cb3' Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype. I am moving my webserver from NT4 using SQL...
11
by: altreed | last post by:
Hi, I am new to ASP, HTML and iis. I have my asp code working so that I can retrieve my desired record from the database. I can place the data on the screen in table form. All works fine. ...
0
by: sonasiva | last post by:
hai Iam creating website using ASP i wnts my clients to register first to vist site using username and password,,this i need to do iam getting error like this ADODB.Recordset (0x800A0BB9)...
6
by: =?Utf-8?B?ZWdzZGFy?= | last post by:
I'm having issues to use my recordset, this is the error I'm getting: ResponsablePropuesta.Observaciones Description: An unhandled exception occurred during the execution of the current web...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.