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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Header Error

Status
Not open for further replies.

necta

Technical User
Mar 8, 2004
35
MY
I have this problem but i couldn't see the cause. What could be wrong?

Response object error 'ASP 0156 : 80004005'

Header Error

/wemes/exmDel.asp, line 27

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


<%
Dim wCON, wRS, sql
Set wCON = Server.CreateObject("ADODB.Connection")
wCON.ConnectionTimeout = 15
wCON.CommandTimeout = 30
wCON.Open "DBQ=" & Server.MapPath("WEMES.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20;", "username", "password"
exmID = Request("exmID")
'Response.Write(Request("exmID"))

Set wRS = Server.CreateObject("ADODB.Recordset")
sql = "DELETE * FROM TblExam WHERE exmID= '" & exmID &"' "
'Response.Write(sql)
Set wRS=wCON.Execute(sql)

'wRS.Close:Set wRS=Nothing
wCON.Close:Set wCON=Nothing
Response.Redirect("exmAdd.asp")
%>
 
which is line 27?

The problem is basically that you are trying to write return HTML to the client and then you are performing a Response.Redirect. This will cause the error you are getting.

Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Sounds like PWS or IIS4... under IIS5 and higher buffering is turned on by default.
 
One option you could try is to do a response.Clear before that Response.Redirect. that way if data has ben written to the buffer already it will be cleared.

-T

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
I turned off ssl, disabled the firewall, I have access to the file, and changed the code back to the original (not specified the full url), still hangs unfortunately.

Is there an alternative way to do this?

Thanks everyone,
Marika
 

Line 27:Response.Redirect("exmAdd.asp")
 
Hi, Tony,
Where did i write to the client browser? I don't quite undestand.
 
Probably some characters between ASP tags. Spaces, letters, whatever.
These characters also go to client response. For example:

Code:
blah <% ...

or

%> blah <%

Btw. what version of web server you use?
 
Have you got any code above the code you posted? i.e. Is there anything above this?
Code:
<%
Dim wCON, wRS, sql
Set wCON = Server.CreateObject("ADODB.Connection")
wCON.ConnectionTimeout = 15
wCON.CommandTimeout = 30
wCON.Open "DBQ=" & Server.MapPath("WEMES.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20;", "username", "password"
exmID = Request("exmID")
'Response.Write(Request("exmID"))

Set wRS = Server.CreateObject("ADODB.Recordset")
sql = "DELETE * FROM TblExam WHERE exmID= '" & exmID &"' "
'Response.Write(sql)
Set wRS=wCON.Execute(sql)  

'wRS.Close:Set wRS=Nothing
wCON.Close:Set wCON=Nothing
Response.Redirect("exmAdd.asp")
%>

Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top