Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2004, 07:41 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Think I have a memory leak, need advice

Hello,

The code I have listed below seems to be causing Inetinfo.exe to jump up to 100%. The OS is NT4 with the NT4 option pack. Old school I know.

Code:
<% If Request.QueryString("status")="approve" Then

'updating por table sets Admin to null and new margin numbers assigned
set rs_o = server.CreateObject("ADODB.recordset")
sql="select * from por where spec='"&Request.QueryString("spec")& "' and por_id='" & trim(Request.QueryString("por_id"))& "'"    
rs_o.Open sql,ConnectTo,3,3

'assign approved status 
set rs_c = server.createobject("ADODB.Recordset")
sql1="select * from por_change where por_id='"&Request.QueryString("por_id")&"' and id='"&Request.QueryString("id")&"'"     
rs_c.Open sql1,ConnectTo,3,3 
rs_c("co_status")="approved"
'rs_c("m_a_comment")=rs_c("m_a_comment")&"<br>"&Request.Form("m_a_comment")
rs_c.update
'rs_c.close
'set rs_c = nothing

rs_o("podate")=NULL
rs_o("podate1")=NULL
rs_o("podate2")=NULL
rs_o("rnumber")=NULL
rs_o("fs_stamp")=NULL
rs_o("ba_stamp")=NULL
rs_o("purchs_stamp")=NULL
rs_o("ponum_stamp")=NULL
rs_o("change_order")=rs_c("m_a_comment")
'rs("scnhours")=Request.Form("scnhours")
'rs("instsell")=Request.Form("instsell")
'rs("estcost")=Request.Form("estcost")
'rs("scncost")=Request.Form("scncost")
rs_o("total_change")=rs_c("c_total_change")
rs_o("totalcost")=rs_c("c_totalcost")
rs_o("instmargin")=rs_c("c_instmargin")
'rs("estmargin")=Request.Form("estmargin")
rs_o("totalprice")=rs_c("c_vendor_cost")
rs_o("process")=6
'rs("change_order")=Request.Form("change_order")
rs_o.update

    'sql1="select top 1* from por_change order by id desc"     
    'rs_c.Open sql1,ConnectTo,3,3
    'id=rs_c("id")
    'rs_c.close
    'set rs_c=nothing 

    Set objMail = Server.CreateObject("CDONTS.NewMail")
    'Recipients deleted to protect the names of the innocent

    link="<br><b>A change order has been submitted for Spec "&rs_o("spec")&"  and is ready for administrative review. </b><br>Please click on the link below to complete this portion of processing<br><a  href='http://lmyr2d2a/fssr/por.asp?spec="&rs_o("spec")&"&por_id="&rs_o("por_id")&"'>POR FOR SPEC "&rs_o("spec")&"</a><br><br>"
    objMail.Body=link
    objMail.Subject="POR Change Order"

    objMail.BodyFormat=0
    objMail.MailFormat=0


    objMail.importance=0
    objMail.Send
    Set objMail = nothing
    rs_o.close
    rs_c.close
    set rs_o = nothing
    set rs_c = nothing
%>
Sorry for the lousy formatting and all the comments. I'm still debugging this so I need to be able to grab variables every now and then. Any help would be appreciated.

Thanks in advance.
 
Old March 12th, 2004, 03:45 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Can't see a reason why this would cause this behavior.

You might want to avoid using your magic number s (e.g. rs_o.Open sql,ConnectTo,3,3) to make the code more readable. Check out this: http://www.adopenstatic.com/faq/800a0bb9step2.asp for more info.

rs_o.Open sql,ConnectTo,adOpenStatic,adLockPessimistic ( or whatever the number mean)

is much easier to understand than

rs_o.Open sql,ConnectTo,3,3

To find out what is causing the problem, create a copy of the page, remove anything you don't need and then one by one add your code block back in.

Right now, the code is, as you said yourself, lousy formatted which makes it hard to read.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory leak in a loop neilsands Java Basics 4 March 17th, 2010 05:59 AM
Looking for Memory Leak Advice Bill_Thompson Visual C++ 0 October 16th, 2007 05:42 PM
IE Memory Leak Jman82 BOOK: Professional Ajax ISBN: 978-0-471-77778-6 0 July 6th, 2006 05:22 PM
Memory Leak in ADO Seeja Pro VB Databases 1 December 27th, 2004 07:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.