超出响应缓冲区限制
我正在运行一个简单的查询来从我的数据库中获取数据&显示它们。我收到一条错误消息,指出超过响应缓冲区限制
。
错误是:响应对象错误“ASP 0251:80004005”
超出响应缓冲区限制
/abc/test_maintenanceDetail.asp,第 0 行
ASP 页的执行导致响应缓冲区超出其配置的限制。
我还在循环中尝试了 Response.flush ,并在页面顶部使用了response.buffer = false ,但我仍然没有收到任何数据。
我的数据库包含 5600 条记录,请给我一些步骤或代码来解决该问题。
I am running a simple query to get data out of my database & display them. I'm getting an error that says Response Buffer Limit Exceeded
.
Error is : Response object error 'ASP 0251 : 80004005'
Response Buffer Limit Exceeded
/abc/test_maintenanceDetail.asp, line 0
Execution of the ASP page caused the Response Buffer to exceed its configured limit.
I have also tried Response.flush
in my loop and also use response.buffer = false
in my top of the page, but still I am not getting any data.
My database contains 5600 records for that, Please give me some steps or code to solve the issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
我知道这已经太晚了,但对于遇到此问题的其他人来说:如果您使用某种循环(在我的例子中是 Do-While)来显示数据,请确保您正在移动到下一条记录(在我的例子中,是 rs.MoveNext)。
I know this is way late, but for anyone else who encounters this problem: If you are using a loop of some kind (in my case, a Do-While) to display the data, make sure that you are moving to the next record (in my case, a rs.MoveNext).
以下是 Microsoft 支持页面对此的说明:
https://support.microsoft.com/en-us/help/944886/error-message-when-you-use-the-response-binarywrite-method-in-iis-6-an。
但在 GUI 中更容易:
Here is what a Microsoft support page says about this:
https://support.microsoft.com/en-us/help/944886/error-message-when-you-use-the-response-binarywrite-method-in-iis-6-an.
But it’s easier in the GUI:
发生这种情况的原因是缓冲默认打开,而 IIS 6 无法处理大响应。
在经典 ASP 中,在页面顶部的
<%@Language="VBScript"%>
之后添加:<%Response.Buffer = False%>
在 ASP.NET 中,您可以将
Buffer="False"
添加到 Page 指令中。例如:
<%@Page Language="C#" Buffer="False"%>
The reason this is happening is because buffering is turned on by default, and IIS 6 cannot handle the large response.
In Classic ASP, at the top of your page, after
<%@Language="VBScript"%>
add:<%Response.Buffer = False%>
In ASP.NET, you would add
Buffer="False"
to your Page directive.For example:
<%@Page Language="C#" Buffer="False"%>
我遇到了同样的问题,我的IIS版本是8.5。增加了
ASP -> 下的
解决了这个问题。响应缓冲限制
限制属性ASP
选项。响应缓冲限制
增加到40194304
(大约 40 MB)。I faced the same kind of issue, my IIS version is 8.5. Increased the
Response Buffering Limit
under theASP -> Limit Properties
solved the issue.ASP
option.Response Buffering Limit
to40194304
(approximately 40 MB) .如果不允许您在服务器级别更改缓冲区限制,则需要使用 <%Response.Buffer = False%>方法。
但是,如果您仍然收到此错误并且页面上有一个大表,则罪魁祸首可能是表本身。根据设计,某些版本的 Internet Explorer 会在呈现到页面之前缓冲整个内容。因此,即使您告诉页面不要缓冲内容,表元素也可能会被缓冲并导致此错误。
一些替代解决方案可能是对表结果进行分页,但如果必须显示整个表并且它有数千行,请在表生成循环的中间添加这行代码:<% Response.Flush %>。出于速度考虑,您可能还需要考虑添加一个基本计数器,以便刷新仅每 25 或 100 行左右发生一次。
不缓冲输出的缺点:
有关详细信息,请参阅此知识库文章http://support.microsoft.com/kb/925764
这有帮助。
If you are not allowed to change the buffer limit at the server level, you will need to use the <%Response.Buffer = False%> method.
HOWEVER, if you are still getting this error and have a large table on the page, the culprit may be table itself. By design, some versions of Internet Explorer will buffer the entire content between before it is rendered to the page. So even if you are telling the page to not buffer the content, the table element may be buffered and causing this error.
Some alternate solutions may be to paginate the table results, but if you must display the entire table and it has thousands of rows, throw this line of code in the middle of the table generation loop: <% Response.Flush %>. For speed considerations, you may also want to consider adding a basic counter so that the flush only happens every 25 or 100 lines or so.
Drawbacks of not buffering the output:
See this KB article for more information http://support.microsoft.com/kb/925764
Hope that helps.
太感谢了!
<%Response.Buffer = False%> 效果非常好!
我的 asp/HTML 表返回大约 2700 条记录的空白页。以下调试行有助于暴露缓冲问题:我按如下方式替换 Do While 循环,并使用我的限制数字来查看发生了什么:
Replace
Do While not rs.EOF
'etc 。 ...写入表行的代码块
rs.moveNext
Loop
with
Do While recount < 2500
if rs.EOF then recount = 2501
'etc .... 写入表行的代码块
rs.moveNext
Loop
response.write "recount = " &重新计数
提高或降低2500和2501,看看是否是缓冲区问题。对于我的记录集,我可以看到大约 2700 条记录发生了空白页返回、空白表,祝大家好运,再次感谢您解决这个问题!这是一个简单而伟大的解决方案!
Thank you so much!
<%Response.Buffer = False%> worked like a charm!
My asp/HTML table that was returning a blank page at about 2700 records. The following debugging lines helped expose the buffering problem: I replace the Do While loop as follows and played with my limit numbers to see what was happening:
Replace
Do While not rs.EOF
'etc .... your block of code that writes the table rows
rs.moveNext
Loop
with
Do While reccount < 2500
if rs.EOF then recount = 2501
'etc .... your block of code that writes the table rows
rs.moveNext
Loop
response.write "recount = " & recount
raise or lower the 2500 and 2501 to see if it is a buffer problem. for my record set, I could see that the blank page return, blank table, was happening at about 2700 records, good luck to all and thank you again for solving this problem! Such a simple great solution!
您可以按如下方式增加限制:
将其更改为 20MB (20971520)。
You can increase the limit as follows:
Changing it to 20MB (20971520).
对同一错误消息的另一个答案(这刚刚解决了我的问题)是系统驱动器磁盘空间不足。意味着大约 700kb 是免费的。在这台非常旧的服务器上删除大量未使用的内容,然后重新启动 IIS 和网站(可能只需要 IIS),问题就消失了。
我确信其他答案对大多数人来说更有用,但为了快速修复,只需确保系统驱动器有一些可用空间即可。
One other answer to the same error message (this just fixed my problem) is that the System drive was low on disk space. Meaning about 700kb free. Deleting a lot of unused stuff on this really old server and then restarting IIS and the website (probably only IIS was necessary) cause the problem to disappear for me.
I'm sure the other answers are more useful for most people, but for a quick fix, just make sure that the System drive has some free space.
我纠正了错误“ASP 0251:80004005”响应缓冲区限制,如下所示:
要增加 IIS 6 中的缓冲限制,请按照下列步骤操作:
单击“开始”,单击“运行”,键入 cmd,然后单击“确定”。
键入以下命令,然后按 Enter:
cd /d %systemdrive%\inetpub\adminscripts
键入以下命令,然后按 Enter:
cscript.exe adsutil.vbs SET w3svc/aspbufferinglimit LimitSize
注意 LimitSize 表示缓冲限制大小(以字节为单位)。例如,数字 67108864 将缓冲限制大小设置为 64 MB。
要确认缓冲区限制设置正确,请按照下列步骤操作:
单击“开始”,单击“运行”,键入 cmd,然后单击“确定”。
键入以下命令,然后按 Enter:
cd /d %systemdrive%\inetpub\adminscripts
键入以下命令,然后按 Enter:
cscript.exe adsutil.vbs GET w3svc/aspbufferinglimit
引用 https://support.microsoft。 com/en-us/kb/944886
I rectified the error 'ASP 0251 : 80004005' Response Buffer Limit as follow:
To increase the buffering limit in IIS 6, follow these steps:
Click Start, click Run, type cmd, and then click OK.
Type the following command, and then press ENTER:
cd /d %systemdrive%\inetpub\adminscripts
Type the following command, and then press ENTER:
cscript.exe adsutil.vbs SET w3svc/aspbufferinglimit LimitSize
Note LimitSize represents the buffering limit size in bytes. For example, the number 67108864 sets the buffering limit size to 64 MB.
To confirm that the buffer limit is set correctly, follow these steps:
Click Start, click Run, type cmd, and then click OK.
Type the following command, and then press ENTER:
cd /d %systemdrive%\inetpub\adminscripts
Type the following command, and then press ENTER:
cscript.exe adsutil.vbs GET w3svc/aspbufferinglimit
refers to https://support.microsoft.com/en-us/kb/944886
如果你正在寻找原因并且不想与系统设置作斗争,这是我遇到的两种主要情况:
If you are looking for the reason and don't want to fight the system settings, these are two major situations I faced:
就我而言,我只是在 rs.Open 之前写了这一行 .....
Response.flush
rs.Open query, conn
In my case i just have writing this line before rs.Open .....
Response.flush
rs.Open query, conn
这也可能是由于 CursorTypeEnum 造成的。我的场景是初始值等于 CursorTypeEnum.adOpenStatic 3。
更改为默认值 CursorTypeEnum.adOpenForwardOnly 0 后,它恢复正常。
It can be due to CursorTypeEnum also. My scenario was the initial value equal to CursorTypeEnum.adOpenStatic 3.
After changed to default, CursorTypeEnum.adOpenForwardOnly 0, it backs to normal.