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

Discussion in 'ASP .Net Web Services' started by Sam, Jan 31, 2004.

  1. Sam

    Sam Guest

    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,adParamReturnValue
    .Parameters.append re
    set actkey=.CreateParameter("actkey",adInteger,adParamOutput
    .Parameters.append actke
    set name=.CreateParameter("name",advarchar,adParamInput,100,fname
    .Parameters.append nam
    set lname=.CreateParameter("lname",adVarChar,adParamInput,100,lname
    .Parameters.append lnam
    set address=.CreateParameter("address",adVarChar,adParamInput,250,add
    .Parameters.append addres
    set city=.CreateParameter("city",adVarChar,adParamInput,100,city
    .Parameters.append cit
    set zip=.CreateParameter("zip",adVarChar,adParamInput,50,zip
    .Parameters.append zi
    set state=.createparameter("state",adinteger,adparaminput,,state
    .Parameters.append stat
    set country=.createparameter("country",adinteger,adparaminput,,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,adParamInput,100,email
    .Parameters.append emai
    set passw=.CreateParameter("passw",advarchar,adParamInput,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="&pwd&"&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,adParamInput,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,adParamInput,255,Biz_Add1)
    .Parameters.append p4
    set p5 =.CreateParameter("Biz_Citi",adVarChar,adParamInput,100,Biz_Citi)
    .Parameters.append p5
    set p6 =.CreateParameter("Biz_State",adInteger,adParamInput,, Biz_State)
    .Parameters.append p6
    set p7 =.CreateParameter("Biz_Zip",adVarChar,adParamInput,50,Biz_Zip)
    .Parameters.append p7
    set p8 =.CreateParameter("Biz_Country",adInteger,adParamInput,,Biz_Country)
    .Parameters.append p8
    set p9 =.CreateParameter("Biz_Email",adVarChar,adParamInput,100,Biz_Email)
    .Parameters.append p9
    set p10 =.CreateParameter("Biz_Contact",adVarChar,adParamInput,100,Biz_Contact)
    .Parameters.append p10

    set p11 =.CreateParameter("Biz_ConEmail",adVarChar,adParamInput,100,Biz_ConEmail)
    .Parameters.append p11
    set p12 =.CreateParameter("Biz_Phone",adVarChar,adParamInput,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,adParamInput,,Biz_subcat(1))
    .Parameters.append p16
    set p17 =.CreateParameter("Biz_desc",adVarChar,adParamInput,3000,Biz_desc)
    .Parameters.append p17
    set p18 =.CreateParameter("Biz_keywords",adVarChar,adParamInput,255,Biz_keywords)
    .Parameters.append p18
    set p19 =.CreateParameter("sur_cities",adVarChar,adParamInput,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,adParamReturnValue
    .Parameters.append retva
    set uid=.CreateParameter("uid",adVarChar,adParamInput,100,uid
    .Parameters.append ui
    set pass=.CreateParameter("pass",adVarChar,adParamInput,100,pwd
    .Parameters.append pas
    set key=.CreateParameter("key",adInteger,adParamInput,,actkey
    .Parameters.append ke
    set user=.CreateParameter("user",adVarChar,adParamOutput,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,adparamoutput,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,adParamReturnValue
    .Parameters.append retva
    set pid=.createparameter("id",adinteger,adparaminput,,imgid
    .parameters.append pi
    set pdesc=.createparameter("desc",advarchar,adparaminput,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&"',default)
    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,conemail,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&"','"&replace(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,255,Add1)
    .Parameters.append addr1
    set city =.CreateParameter("Citi",adVarChar,adParamInput,100,Citi)
    .Parameters.append city
    set phones =.CreateParameter("Phone",adVarChar,adParamInput,20,Phone)
    .Parameters.append phones
    set faxes =.CreateParameter("Fax",adVarChar,adParamInput,20,Fax)
    .Parameters.append faxes
    set emails =.CreateParameter("BizEmail",adVarChar,adParamInput,100,Email)
    .Parameters.append emails
    set contact =.CreateParameter("Contact",adVarChar,adParamInput,100,Con)
    .Parameters.append contact
    set conemails =.CreateParameter("ConEmail",adVarChar,adParamInput,100,ConEmail)
    .Parameters.append conemails
    set descr =.CreateParameter("desc",adVarChar,adParamInput,3000,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,adParamInput,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,memcountry,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,adParamReturnValue)
    .Parameters.append retval
    set mail=.CreateParameter("email",adVarChar,adParamInput,100,mail)
    .Parameters.append mail
    set pass=.CreateParameter("pass",adVarChar,adParamOutput,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,adParamOutput,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
    %>
     
    Sam, Jan 31, 2004
    #1
    1. Advertising

  2. "Sam" <> wrote in message
    news:...
    > 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
     
    Egbert Nierop \(MVP for IIS\), Jan 31, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KK
    Replies:
    2
    Views:
    646
    Big Brian
    Oct 14, 2003
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,073
    Smokey Grindel
    Dec 2, 2006
  3. bernadou

    Force multi line field value to output with line breaks?

    bernadou, Jan 22, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    371
    bernadou
    Jan 23, 2006
  4. mailbox

    Line breaks in HTML code

    mailbox, May 26, 2005, in forum: ASP General
    Replies:
    5
    Views:
    119
    please-answer-here
    May 26, 2005
  5. Marek Stepanek
    Replies:
    12
    Views:
    423
    Peter J. Holzer
    Sep 2, 2006
Loading...

Share This Page