Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response object error 'ASP 0156 : 80004005' 1

Status
Not open for further replies.

CrystalVis

Technical User
Jun 26, 2002
200
US
I create a simple default.htm page to call up an ASP page that contains the report information. When the page loads, I click the link and receive this error message:

'Response object error 'ASP 0156 : 80004005'

Header Error

/SimpleSetLogOnInfo/SimpleSetLogonInfo.asp, line 4

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.'

Here is the code in the default.htm page

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;><HTML><HEAD>
<META http-equiv=Content-Type content=&quot;text/html; charset=unicode&quot;>
<META content=&quot;MSHTML 5.50.4522.1800&quot; name=GENERATOR></HEAD>
<BODY>

<P><a href=&quot;SimpleSetLogonInfo.asp&quot;>Simple Set Logon Info!!</a></P>
</BODY></HTML>

Can you please tell me what is the error message means and how to go about fix it. Your input is greatly appreciated.
TIA
 
can you post the code for SimpleSetLogonInfo.asp please??

This usually happens when you have written some HTML output and then tried to redirect using ASP. Any ASP redirection needs to be done before the page content is written. Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Tony,

Thank you for your respond. Here is the code in the main ASP page.

<%@ LANGUAGE=&quot;VBSCRIPT&quot; %>
<title>Crystal Reports ASP - Using Set Logon Info</title>

<%Response.Buffer=True%>

<%

reportname = &quot;SimpleSetLogonInfo.rpt&quot;

%>
<!-- #include file=&quot;AlwaysRequiredSteps.asp&quot; -->
<%


userid = &quot;YOUR_DATABASE_USERID&quot;
password = &quot;YOUR_DATABASE_PASSWORD&quot;


session(&quot;oRpt&quot;).MorePrintEngineErrorMessages = False
session(&quot;oRpt&quot;).EnableParameterPrompting = False


set crtable = session(&quot;oRpt&quot;).Database.Tables.Item(1)
crtable.SetLogonInfo &quot;Automation&quot;, &quot;pubs&quot;, cstr(userid), cstr(password)

%>
<!-- #include file=&quot;MoreRequiredSteps.asp&quot; -->
<%

%>


<!-- #include file=&quot;SmartViewerActiveX.asp&quot; -->

<%

%>





CODE IN 'AlwaysRequireSteps.asp' PAGE
<%
If Not IsObject (session(&quot;oApp&quot;)) Then
Set session(&quot;oApp&quot;) = Server.CreateObject(&quot;CrystalRuntime.Application&quot;)
End If

Path = Request.ServerVariables(&quot;PATH_TRANSLATED&quot;)
While (Right(Path, 1) <> &quot;\&quot; And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend

If IsObject(session(&quot;oRpt&quot;)) then
Set session(&quot;oRpt&quot;) = nothing
End if

Set session(&quot;oRpt&quot;) = session(&quot;oApp&quot;).OpenReport(path & reportname, 1)

session(&quot;oRpt&quot;).MorePrintEngineErrorMessages = False
session(&quot;oRpt&quot;).EnableParameterPrompting = False

%>


CODE IN MoreRequiredSteps.asp PAGE

<%
On Error Resume Next
session(&quot;oRpt&quot;).ReadRecords
If Err.Number <> 0 Then
Response.Write &quot;An Error has occured on the server in attempting to access the data source&quot;
Else

If IsObject(session(&quot;oPageEngine&quot;)) Then
set session(&quot;oPageEngine&quot;) = nothing
End If
set session(&quot;oPageEngine&quot;) = session(&quot;oRpt&quot;).PageEngine
End If

%>
 
this line

<%Response.Buffer=True%>

needs to be executed before any HTML code is written. Therefore place this line at the top of the page.

Let me know if this fixes it.

You should also add the <HTML>,<HEAD></HEAD>,<BODY> etc... tags to the page. Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Tony,

It works...Now I am having problem connecting to the server. I'll attempt to resolve it first before post the question here. Many thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top