[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 685
  • Last Modified:

error 'ASP 0251 : 80004005' Response Buffer Limit Exceeded

Hello Experts,

I have an ASP VBScript webpages that outputs XML. the page in question is currently trying to output upto 10,000 records which include a NVARCHAR(6000) field - the code is below..

The problem I'm having is that when I try to access the page - I just get an error, so when i stick it through FeedValidator i get the following message -

"01.<font face="Arial" size=2>
02.<p>Response object</font> <font face="Arial" size=2>error 'ASP 0251 : 80004005'</font>
03.<p>
04.<font face="Arial" size=2>Response Buffer Limit Exceeded</font>
05.<p>
06.<font face="Arial" size=2>/feeds/am/indeed.asp</font><font face="Arial" size=2>, line 0</font>
07.<p>
08.<font face="Arial" size=2>Execution of the ASP page caused the Response Buffer to exceed its configured limit.
09.</font> "

Is there anything I can do within the ASP code to resolve this?

Many thanks

GTN
<%@LANGUAGE="VBSCRIPT"%><?xml version="1.0" encoding="ISO-8859-1"?>
<% Response.Buffer = true
   Response.ContentType = "text/xml"
   
Function ApplyXMLFormatting(strInput)
  strInput = Replace(strInput,"&", "&amp;")
  strInput = Replace(strInput,"'", "&apos;")
  strInput = Replace(strInput,"""", "&quot;")
  strInput = Replace(strInput, ">", "&gt;")
  strInput = Replace(strInput,"<","&lt;")
  strInput = Replace(strInput,"&amp;#163;","&pound;")

  
  ApplyXMLFormatting = strInput
End Function   
    %>
<!--#include file="../../Connections/recruta2.asp" -->
<!--#include file="../../Connections/removeutfformatting.asp" -->
<%
Dim searchresults
Dim searchresults_cmd
Dim searchresults_numRows

Set searchresults_cmd = Server.CreateObject ("ADODB.Command")
searchresults_cmd.ActiveConnection = MM_recruta2_STRING
searchresults_cmd.CommandText = "SELECT  A.JBAID,    A.JBATitle,    A.JBALocation,    A.JBACategory,    A.JBAPayRate,    A.JBADescription,    A.JBAEmplymentType,  A.JBAFeaturedJob, CONVERT(CHAR(11),A.JBADatePosted,106) AS JBADatePosted,    C.JBCLName,   S.JBSURL,    S.JBSURLShort,    S.JBSRegion   FROM dbo.JBAdvert A    inner join dbo.JBClient C on A.JBAClientID = C.JBCLID   inner join dbo.JBSite S on A.JBASiteID = S.JBSSiteID   WHERE JBSSIteOwnerID  = 2 ORDER BY JBSURL,JBAID DESC" 
searchresults_cmd.Prepared = true

Set searchresults = searchresults_cmd.Execute
searchresults_numRows = 0
%>
<source>
  <publisher></publisher> 
  <publisherurl></publisherurl> 

<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
searchresults_numRows = searchresults_numRows + Repeat1__numRows
%>
<% 
While ((Repeat1__numRows <> 0) AND (NOT searchresults.EOF)) 
%>
<job>
<source><%=(searchresults.Fields.Item("JBSURLShort").Value)%></source>
<title><![CDATA[<%=ApplyXMLFormatting(searchresults.Fields.Item("JBATitle").Value)%> - <%=ApplyXMLFormatting(searchresults.Fields.Item("JBAPayRate").Value)%> - <%=ApplyXMLFormatting(searchresults.Fields.Item("JBALocation").Value)%>]]></title>
<date><![CDATA[<%=ApplyXMLFormatting(searchresults.Fields.Item("JBADatePosted").Value)%>]]></date>
<referencenumber><![CDATA[<%=ApplyXMLFormatting(searchresults.Fields.Item("JBAID").Value)%>]]></referencenumber>
<url><![CDATA[<%=ApplyXMLFormatting(searchresults.Fields.Item("JBSURL").Value)%>/detail~ID~<%=(searchresults.Fields.Item("JBAID").Value)%>~<%=Server.URLEncode(searchresults.Fields.Item("JBACategory").Value)%>-jobs-<%=Server.URLEncode(removeutfcharacters(searchresults.Fields.Item("JBATitle").Value))%>-jobs-in-<%=Server.URLEncode(searchresults.Fields.Item("JBALocation").Value)%>-<%=Server.URLEncode(searchresults.Fields.Item("JBCLName").Value)%>-jobs-in-<%=ApplyXMLFormatting(searchresults.Fields.Item("JBSRegion").Value)%>.htm]]></url>
<company><![CDATA[<%=ApplyXMLFormatting(searchresults.Fields.Item("JBCLName").Value)%>]]></company>
<city><![CDATA[<%=ApplyXMLFormatting(searchresults.Fields.Item("JBALocation").Value)%>]]></city>
<country><![CDATA[UK]]></country>
<description><![CDATA[<%=ApplyXMLFormatting(searchresults.Fields.Item("JBADescription").Value)%>]]></description>
<salary><![CDATA[<%=ApplyXMLFormatting(searchresults.Fields.Item("JBAPayRate").Value)%>]]></salary>
<jobtype><![CDATA[<%=ApplyXMLFormatting(searchresults.Fields.Item("JBAEmplymentType").Value)%>]]></jobtype>
<category><![CDATA[<%=ApplyXMLFormatting(searchresults.Fields.Item("JBACategory").Value)%>]]></category>
<sponsored><![CDATA[<%IF searchresults.Fields.Item("JBAFeaturedJob").Value = "Y" then%>1<%End IF%>]]></sponsored>
</job>
  <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  searchresults.MoveNext()
Wend
%>
</source>
<%
searchresults.Close()
Set searchresults = Nothing
%>

Open in new window

0
garethtnash
Asked:
garethtnash
  • 4
  • 3
  • 2
  • +1
2 Solutions
 
Om PrakashCommented:
Try aadding following code
 if Repeat1__numRows mod 10 = 0 then
      Response.Flush()
 end if

after following lines:

Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
0
 
AbarajCommented:
Use the Response.Flush before the 'Wend'. To flesh the data.
check this article for more information
http://support.microsoft.com/kb/925764 
0
 
garethtnashAuthor Commented:
Just to confirm, like so?
  <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  searchresults.MoveNext()
Wend
%>
<% if Repeat1__numRows mod 10 = 0 then
      Response.Flush()
 end if%>
 
?
Thank you


 
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Om PrakashCommented:

<% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  if Repeat1__numRows mod 10 = 0 then 
        Response.Flush() 
  end if
  searchresults.MoveNext()
Wend
%>

Open in new window

0
 
AbarajCommented:
it should be like this
<%
  Repeat1__index=Repeat1__index+1
 Repeat1__numRows=Repeat1__numRows-1
 searchresults.MoveNext()
if Repeat1__numRows mod 10 = 0 then
      Response.Flush()
 end if
Wend
%>
0
 
garethtnashAuthor Commented:
Thank you both, just very quickly, I've done this -
  <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  searchresults.MoveNext()
   if Repeat1__numRows mod 10 = 0 then
      Response.Flush()
 end if
Wend
%>
but is there a difference between that and  -
<%     Repeat1__index=Repeat1__index+1    Repeat1__numRows=Repeat1__numRows-1    if Repeat1__numRows mod 10 = 0 then           Response.Flush()     end if    searchresults.MoveNext()  Wend  %>
Thank you :-)
0
 
AbarajCommented:
nothiong difference. In my code, after moving to next record, flush the values. And as per om_prakash_p's code, flush the value and move to next record.
you implement any one.
0
 
garethtnashAuthor Commented:
Thank you both
0
 
AbarajCommented:
Hi garethtnash,
Dont try to get the complete code from the experts. Try yourself from my 1st posting with the article. Go through that and try yourself.
Thanks
0
 
LeroyJamesCommented:
FYI you can change the buffer length. in the IIS Metabase
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now