Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > need to find out why the code breaks at line #285 please Help

Reply
Thread Tools

need to find out why the code breaks at line #285 please Help

 
 
Sam
Guest
Posts: n/a
 
      01-31-2004
Error Message
Response object error 'ASP 0156 : 80004005'

Header Error

/includes/utilities.asp, line 285

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

-------------------------------------------------------------------------------------------------------------------------
File name is utilities.as
------------------------------------------------------------------------------------------------------------------------
<!--#include file="i_conn.asp" --><
function newmember(byval fname,byval lname,byval add,byval city,byval zip,
byval state,byval country,byval tel,byval fax,byval email,byval pwd,byval sur

set cmd=server.CreateObject("adodb.command"

with cm
.ActiveConnection=c
.CommandText="sp_newmember
.CommandType=
set ret=.CreateParameter("retval",adInteger,adParamRet urnValue
.Parameters.append re
set actkey=.CreateParameter("actkey",adInteger,adParam Output
.Parameters.append actke
set name=.CreateParameter("name",advarchar,adParamInpu t,100,fname
.Parameters.append nam
set lname=.CreateParameter("lname",adVarChar,adParamIn put,100,lname
.Parameters.append lnam
set address=.CreateParameter("address",adVarChar,adPar amInput,250,add
.Parameters.append addres
set city=.CreateParameter("city",adVarChar,adParamInpu t,100,city
.Parameters.append cit
set zip=.CreateParameter("zip",adVarChar,adParamInput, 50,zip
.Parameters.append zi
set state=.createparameter("state",adinteger,adparamin put,,state
.Parameters.append stat
set country=.createparameter("country",adinteger,adpar aminput,,country
.Parameters.append country
set tel=.CreateParameter("tel",advarchar,adParamInput, 10,tel
.Parameters.append te
set fax=.CreateParameter("fax",advarchar,adParamInput, 10,fax
.Parameters.append fa
set email=.CreateParameter("email",adVarChar,adParamIn put,100,email
.Parameters.append emai
set passw=.CreateParameter("passw",advarchar,adParamIn put,100,pwd
.Parameters.append pass
set surv=.createparameter("sur",advarchar,adparaminput ,20,sur
.Parameters.append sur
.Execut
retval=.Parameters("retval"
actkey=.Parameters("actkey"


end wit
set cmd=nothin
select case retva

case

msg="Your account is created successfully. You will be receiving your activation key, userid and password on the email address provided by you.
message="This is an autogenerated message from RIS server, please do not reply." & vbc
message=message+"Click on the link below to complete your basic registration process." & vbc
message=message+"You will be required to login using your ID (your email address) and the password. " & vbc
message=message+"Click here <a href=http://www.ezrent.com/newlogin.asp?login="&request("txtemail")&"&pwd="&p wd&"&actkey="&actkey&"> Here </a>" &vbc
message=message+"If due to any reason above link does not work, please visit http://www.ezrent.com/newlogin.asp and enter the following information" & vbc
message=message+"Login: " & request("txtemail") &vbc
message=message+"Password: " &pwd &vbc
message=message+"Activation Key: " & actkey & vbcr &vbc
message=message+"Thank you <br><br>Rental Industry Services Inc.

set objmail = Server.CreateObject("CDONTS.NewMail"
objmail.from = "
objmail.to = request("txtemail"
objmail.subject = "Your registration with ezrent.com
objmail.BodyFormat = 1
objmail.MailFormat =
objmail.Importance =
objmail.body = messag
objmail.sen
case -
msg="Email address already exists. Please check the email address and submit your information again.
end selec
newmember=ms

end functio
function ins_state(byval state,byval cid
cn.execute "exec new_state '" & state & "',"& ci
response.Redirect "manage_locations.asp

end functio
function up_state(byval sid,byval name
cn.execute "edit_state " & sid & ",'" & name & "'"
end function
function del_state(byval sid)
cn.execute "del_state " & sid
end function
function newcountry(byval country,byval ccode)
cn.execute "exec new_country '" & country & "','" & ccode & "'"
end function
function update_country(byval cid,byval cname)
cn.execute "update_count " & cid & ",'"& cname & "'"
end function
function del_country(byval delcount)
cn.execute "sp_delcountry " & delcount
end function
function insert_cat(byval catname)
cn.execute "insert_cat '" & catname & "'"
end function
function del_cat(byval catid)
cn.execute "exec del_cat "& catid
end function
function update_cat(byval catid,byval catname)
cn.execute "exec update_cat " & catid & ",'" & catname & "'"
end function
function insert_subcat(byval subcatname,byval catid)
cn.execute "exec insert_subcat '" & subcatname & "'," & catid
end function
function del_subcat(byval subcatid,byval catid)
cn.execute "exec del_subcat "&subcatid&","&catid
end function
function update_subcat(byval subcatid,byval subcatname,byval catid)
cn.execute "exec update_subcat "&subcatid&",'"&subcatname&"',"&catid
end function


function newlisting(byval Mem_Id,byval Biz_Name,byval Biz_Add,byval Biz_Add1,byval Biz_Citi,byval Biz_State, _
byval Biz_Zip,byval Biz_Country,byval Biz_Email,byval Biz_Contact,byval Biz_ConEmail,byval Biz_Phone,byval Biz_Fax, _
byval Biz_Url,byval Biz_cat, byval Biz_subcat,byval Biz_Desc,byval Biz_keywords,byval sur_cities)

'strinsert= "exec insert_Biz_info "&id&",'"& bizname & "','" & bizadd & "','" & bizadd1 & "','"& citi & "','" _
'&state& "','" & zip & "','" & country & "','" & email & "','" & contact & "','" & conemail & "','" _
'&phone& "','" & fax & "','" & url & "'," & cat & "," &subcat&",'"& desc & "','" & key & "','" & surr & "'"

'cn.execute strinsert

'@Mem_Id, @Biz_Name,@Biz_Add,@Biz_Add1,@Biz_Citi,@Biz_State, @Biz_Zip,@Biz_Country,
'@Biz_Email,@Biz_Contact,@Biz_ConEmail,@Biz_Phone, @Biz_Fax,@Biz_Url,@biz_cat,@Biz_subcat,
'@Biz_Desc,@Biz_keywords,@sur_cities)

cn.execute "BEGIN TRANSACTION"

set cmd=server.CreateObject("adodb.command")

with cmd
.ActiveConnection=cn
.CommandText="insert_Biz_info"
.CommandType=4

set p0 =.CreateParameter("Biz_Id",adInteger,adParamOutput ,,Biz_Id)
.Parameters.append p0

set p1 =.CreateParameter("Mem_Id",adInteger,adParamInput, ,Mem_Id)
.Parameters.append p1
set p2 =.CreateParameter("Biz_Name",adVarChar,adParamInpu t,100,Biz_Name)
.Parameters.append p2
set p3 =.CreateParameter("Biz_Add",adVarChar,adParamInput ,255,Biz_Add)
.Parameters.append p3
set p4 =.CreateParameter("Biz_Add1",adVarChar,adParamInpu t,255,Biz_Add1)
.Parameters.append p4
set p5 =.CreateParameter("Biz_Citi",adVarChar,adParamInpu t,100,Biz_Citi)
.Parameters.append p5
set p6 =.CreateParameter("Biz_State",adInteger,adParamInp ut,, Biz_State)
.Parameters.append p6
set p7 =.CreateParameter("Biz_Zip",adVarChar,adParamInput ,50,Biz_Zip)
.Parameters.append p7
set p8 =.CreateParameter("Biz_Country",adInteger,adParamI nput,,Biz_Country)
.Parameters.append p8
set p9 =.CreateParameter("Biz_Email",adVarChar,adParamInp ut,100,Biz_Email)
.Parameters.append p9
set p10 =.CreateParameter("Biz_Contact",adVarChar,adParamI nput,100,Biz_Contact)
.Parameters.append p10

set p11 =.CreateParameter("Biz_ConEmail",adVarChar,adParam Input,100,Biz_ConEmail)
.Parameters.append p11
set p12 =.CreateParameter("Biz_Phone",adVarChar,adParamInp ut,20,Biz_Phone)
.Parameters.append p12
set p13 =.CreateParameter("Biz_Fax",adVarChar,adParamInput ,20,Biz_Fax)
.Parameters.append p13
set p14 =.CreateParameter("Biz_Url",adVarChar,adParamInput ,50,Biz_Url)
.Parameters.append p14
set p15 =.CreateParameter("Biz_cat",adInteger,adParamInput ,,Biz_cat)
.Parameters.append p15
set p16 =.CreateParameter("Biz_subcat",adInteger,adParamIn put,,Biz_subcat(1))
.Parameters.append p16
set p17 =.CreateParameter("Biz_desc",adVarChar,adParamInpu t,3000,Biz_desc)
.Parameters.append p17
set p18 =.CreateParameter("Biz_keywords",adVarChar,adParam Input,255,Biz_keywords)
.Parameters.append p18
set p19 =.CreateParameter("sur_cities",adVarChar,adParamIn put,1000,sur_cities)
.Parameters.append p19

.Execute

Biz_Id =.Parameters("Biz_Id")

arrsubcat=split(biz_subcat,",")
for i=lbound(arrsubcat) to ubound(arrsubcat)

cn.execute "exec insert_Biz_Sub_Cat " & Biz_Id & "," & arrsubcat(i)

next


end with


cn.execute "COMMIT TRANSACTION"
session("bizid")=biz_id

end function




function get_biz_subcats(byval Biz_Id)

'str_cats = "cat1, cat2"

'get_biz_subcats = str_cats

set scatnames = cn.execute("exec get_biz_subcats " & Biz_Id)


if not scatnames.EOF then
scatnames.movefirst
str_cats = scatnames("SC_name")
scatnames.movenex

while not scatnames.EO
str_cats = str_cats & "," & scatnames("SC_name"
scatnames.movenex
wen

end i


scatnames.clos

get_biz_subcats = str_cat

end functio

function activate_login(byval uid,byval pwd,byval actkey,byval bid
set cmd=server.CreateObject("adodb.command"

with cm
.ActiveConnection=c
.CommandText="sp_checklogin
.CommandType=
set retval=.CreateParameter("retval",adInteger,adParam ReturnValue
.Parameters.append retva
set uid=.CreateParameter("uid",adVarChar,adParamInput, 100,uid
.Parameters.append ui
set pass=.CreateParameter("pass",adVarChar,adParamInpu t,100,pwd
.Parameters.append pas
set key=.CreateParameter("key",adInteger,adParamInput, ,actkey
.Parameters.append ke
set user=.CreateParameter("user",adVarChar,adParamOutp ut,100
.Parameters.append use
set id=.CreateParameter("id",adInteger,adParamOutput
.Parameters.append i


.Execut
retval=.Parameters("retval"
user=.Parameters("user"
id=.Parameters("id"

end wit
select case retva
case
session("varlogin")=tru
varlogin=session("varlogin"
session("user") = use
session("id")=i

if len(trim(bid))>1 the
response.Redirect "query.asp?uid="+bi
els
Response.Redirect "manage_console.asp
end i
case
session("varlogin")=tru
varlogin=session("varlogin"
session("user") = use
session("id")=i

if len(trim(bid))>1 the
response.Redirect "query.asp?uid="+bi
else
Response.Redirect "manage_console.asp
end i
case
Response.Redirect "newlogin.asp
end select

activate_login=retva
end functio
function get_business(byval pid
get_busiess="exec sp_getproperty "&pi
end functio
function getuseremail(byval userid
set cmd=server.CreateObject("adodb.command"
with cm
.activeconnection=c
.commandtext="sp_getemail
.commandtype=

set uid=.createparameter("uid",adinteger,adparaminput, ,userid
.parameters.append ui
set email=.createparameter("email",advarchar,adparamou tput,100
.parameters.append emai
.execut
umail=.parameters("email"
end wit
getuseremail=umai
end functio
function chkmainimg(byval imgid,byval imgdesc
set cmd=server.CreateObject("adodb.command"
with cm
.ActiveConnection=c
.CommandText="sp_checkmainimage
.CommandType=
set retval=.CreateParameter("retval",adInteger,adParam ReturnValue
.Parameters.append retva
set pid=.createparameter("id",adinteger,adparaminput,, imgid
.parameters.append pi
set pdesc=.createparameter("desc",advarchar,adparaminp ut,15,desc
.parameters.append pdes
.execut
retval=.parameters("retval"
chkmainimg=retva
end wit
set cmd=nothin
end functio
function getimgdetails(byval pid
strsql="exec sp_getimgdetails '"&pid&"'
getimgdetails=strsq
end functio
function submitquery(byval proid,byval message,byval email,byval bmail,byval cmail

'cn.execute "insert into queries values('"&proid&"','"&message&"','"&email&"',defau lt)
straddress = emai
objmsg = "You have received a new mail for a query / offer from ezrent.com" & vbcrlf & vbcrl
objmsg = objmsg & "Sender's Email: " & email & vbcrl
objmsg = objmsg & "Original Message: " & vbcrlf & message & vbcrlf & vbcrl
objmsg = objmsg & "This messages is generated by ezrent.com administration on " & Now() & vbcrl

set objmail = Server.CreateObject("CDONTS.NewMail"
objmail.from = emai
objmail.cc = ";"&cmai
objmail.to = bmai
objmail.subject = "Query from ezrent.com
objmail.BodyFormat = 1
objmail.MailFormat =
objmail.Importance =
objmail.body = objms
objmail.sen
retmsg="Your last mail is sent successfully to the Advertiser
submitquery=retmsg
end functio

function delprop(Propid
cn.execute "exec sp_delproperty "& propid
end functio

function editbiz(Bizid,add,add1,citi,phone,fax,email,con,co nemail,desc,name,zip,url,key,sur
'cn.execute
'response.Write "sp_updateprop "&bizid&",'"&add&"','"&add1&"','"&citi&"','"&phone &"','"&fax&"','"&email&"','"&con&"','"&conemail&"' ,'"&desc&"','"&name&"',"&zip&",'"&url&"','"&replac e(key,"'",""&chr(222)&"")&"','"&sur&"'
'response.End

set cmd=server.CreateObject("adodb.command")

with cmd
.ActiveConnection=cn
.CommandText="sp_updateprop"
.CommandType=4

set id =.CreateParameter("BizId",adInteger,adParamInput,, BizId)
.Parameters.append id
set addr =.CreateParameter("Add",adVarChar,adParamInput,255 ,Add)
.Parameters.append addr
set addr1 =.CreateParameter("Add1",adVarChar,adParamInput,25 5,Add1)
.Parameters.append addr1
set city =.CreateParameter("Citi",adVarChar,adParamInput,10 0,Citi)
.Parameters.append city
set phones =.CreateParameter("Phone",adVarChar,adParamInput,2 0,Phone)
.Parameters.append phones
set faxes =.CreateParameter("Fax",adVarChar,adParamInput,20, Fax)
.Parameters.append faxes
set emails =.CreateParameter("BizEmail",adVarChar,adParamInpu t,100,Email)
.Parameters.append emails
set contact =.CreateParameter("Contact",adVarChar,adParamInput ,100,Con)
.Parameters.append contact
set conemails =.CreateParameter("ConEmail",adVarChar,adParamInpu t,100,ConEmail)
.Parameters.append conemails
set descr =.CreateParameter("desc",adVarChar,adParamInput,30 00,desc)
.Parameters.append descr
set bizname =.CreateParameter("BizName",adVarChar,adParamInput ,100,Name)
.Parameters.append bizname
set bizzip =.CreateParameter("BizZip",advarchar,adParamInput, 50,Zip)
.Parameters.append bizzip
set urls=.CreateParameter("Url",adVarChar,adParamInput ,50,Url)
.Parameters.append urls
set keyw =.CreateParameter("keyword",adVarChar,adParamInput ,255,key)
.Parameters.append keyw
set surr =.CreateParameter("surcities",adVarChar,adParamInp ut,1000,sur)
.Parameters.append surr
.Execute
end with
end function

function getuserprofile(memid)
cn.execute "sp_getuserprofile " & memid
end function

function editprofile(memid,memadd,memcity,memstate,memcount ry,memtel,memfax,mempass)
strupdate= "sp_editmemprofile " & memid & ",'" & memadd & "','" & memcity & "'," & memstate & "," & _
memcountry & ",'" & memtel & "','" & memfax & "','" & mempass & "'"
cn.execute strupdate
end function
function deluser(uid)
cn.execute "exec sp_deluser "& uid
end function

function mailpassword(byval mail)
set cmd=server.CreateObject("adodb.command")
with cmd
.ActiveConnection=cn
.CommandText="sp_checkmail"
.CommandType=4
set retval=.CreateParameter("retval",adInteger,adParam ReturnValue)
.Parameters.append retval
set mail=.CreateParameter("email",adVarChar,adParamInp ut,100,mail)
.Parameters.append mail
set pass=.CreateParameter("pass",adVarChar,adParamOutp ut,100)
.Parameters.append pass

.execute
retval=.Parameters("retval")
pass1=.Parameters("pass")

end with
if retval=0 then
message="This is a auto generated mail, please do not reply" & vbcrlf & vbcrlf & vbcrlf

message=message & "Your Password=" & pass & vbcrlf
message=message & "Thank you for your business with ezrent.com" & vbcrlf & vbcrlf
message=message & "Technical team of ezrent.com"
set objmail = Server.CreateObject("CDONTS.NewMail")
objmail.from = ""
objmail.to = Request("txtemail")
objmail.subject = "Your password"
objmail.BodyFormat = 1
objmail.MailFormat = 0
objmail.Importance = 2
objmail.body = message
objmail.send
retval=2
mailpassword=retval
end if
end function

function bizsubcat (byval bizid)
set rssubcat= server.CreateObject("adodb.recordset")
rssubcat.Open cn.execute("get_biz_sub_cat " & bizid)
if not rssubcat.eof and not rssubcat.bof then
strbizcat=null
do until rssubcat.eof
strbizcat=strbizcat&rssubcat(3)&","
rssubcat.movenext
loop
rssubcat.Close
set rssubcat=nothing
end if
bizsubcat=left(strbizcat,(len(strbizcat)-1))
end function
function replacesubcat(byval bizcat,byval subcat,byval cat)
cn.execute "begin tran"
cn.execute "exec sp_updatecat " & bizcat & "," & cat
'cn.execute "go"
cn.execute "exec sp_delete_bizsubcat " & bizcat
'cn.execute "go"

arrsubcat=split(subcat,",")
for i=lbound(arrsubcat) to ubound(arrsubcat)
cn.execute "exec insert_Biz_Sub_Cat " & bizcat & "," & arrsubcat(i)
next
cn.execute "commit tran"
end function
function getuseremail(byval id)
set cmd=server.CreateObject("adodb.command")
with cmd
.ActiveConnection=cn
.CommandText="sp_getuseremail"
.CommandType=4
set uid=.CreateParameter("id",adinteger,adParamInput,, id)
.Parameters.append uid
set umail=.CreateParameter("umail",adVarChar,adParamOu tput,100)
.Parameters.append umail
.execute
uemail=.Parameters("umail")
getuseremail=uemail
set cmd=nothing

end with
end function
function getuserstatus(byval uid)
set rs=server.CreateObject("adodb.recordset")
rs.Open cn.execute("exec sp_getmemstatus "&uid)
memstatus=rs(0)
rs.Close
set rs=nothing
getuserstatus=memstatus
end function
%>
 
Reply With Quote
 
 
 
 
Egbert Nierop \(MVP for IIS\)
Guest
Posts: n/a
 
      01-31-2004
"Sam" <> wrote in message
news:4D96B5E1-AFA6-45A3-9096-...
> Error Message:
> Response object error 'ASP 0156 : 80004005'
>
> Header Error
>
> /includes/utilities.asp, line 285
>
> The HTTP headers are already written to the client browser. Any HTTP

header modifications must be made before writing page content.
The bug is as follows

Response.Buffer = True 'I suppose you have buffering ON using IIS console
Response.Write "Hello World"
Response.Flush

Response.Cookies("blah") = "hi" <---- GENERATES error

the following is generating the same error

Response.Buffer = False
Response.WRite "Hello World"
Respose.Cookies("blah") = "hi" <------ generates error

To get your system working you should first write headers (such as cookies
and caching directives), after that write HTML content...

Success





--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript innerHTML code generates unexplained line-breaks in IE John Ca Javascript 6 10-12-2009 07:06 AM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Beginner: read $array with line breaks line by line Marek Stepanek Perl Misc 12 09-02-2006 10:27 AM
Force multi line field value to output with line breaks? bernadou ASP .Net Web Controls 2 01-23-2006 01:23 PM
Line breaks in HTML code mailbox ASP General 5 05-26-2005 10:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57