If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > dllhost.exe and a sql select

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-19-03, 20:56
ghornet ghornet is offline
Registered User
 
Join Date: Jul 2003
Posts: 23
dllhost.exe and a sql select

Ok I have never run into this before... I am leaking memory. Here is my code. The second select call makes dllhost.exe take up all of my memory. I don't understand why. Everything looks closed adn set to nothing.. any ideas?

Code:
<%@ Language=VBScript %>
<HTML>
	<HEAD>
		<meta name="GENERATOR" Content="Microsoft Visual Studio.NET 7.0">
	<!--#INCLUDE FILE="../HTMLSite/includes/adovbs.asp"'-->
	</head>
	<body>
	
		<% 
set cn = Server.CreateObject("ADODB.Connection")
set rsCustomerInfo = Server.CreateObject("ADODB.Recordset")
cn.Open strConn

Dim ProductID(151)
Dim ProductAmount(151)
Dim i
i = 0
sqlCustomer = "Select CompanyName from Customers Where CustomerID = '" & request.Form("Customer") & "'"
response.Write(sqlCustomer)
rsCustomerInfo = cn.Execute(sqlCustomer)
'This goes through all of the information that is sent to the page and makes a sql statement out of it
for each f in request.Form
	if f <> "Customer" then
		if isNumeric(Request.Form(f)) then
			ProductID(i) = f
			ProductAmount(i) = Request.Form(f)
			'response.Write(productID(i) & " " & ProductAmount(i) & "<br>")
			if i = 0 then
				sqlSelect = "SELECT ProductID, Type, Sizes, Price, Color FROM vProductList Where ProductID = '" & ProductID(i) & "'"
			end if
			if i >= 1 then
				sqlSelect = sqlSelect & " Or ProductID = '" & ProductID(i) & "'"
			end if
			i = i + 1
		end if
	end if
next

'response.Write(sqlSelect)
%>
Confirm Order For <%= rsCustomerInfo("CompanyName") %><br><br>
<table><tr>
<td>Product ID</td>
<td>Type</td>
<td>Size</td>
<td>Price</td>
</tr><tr>
<%

set rsCustomerInfo = nothing

set rsNewOrder = Server.CreateObject("ADODB.Recordset")
set rsNewOrder = cn.Execute(sqlSelect)
While not rsNewOrder.EOF
%>
<td><%= rsNewOrder("ProductID") %></td>
<td><%= rsNewOrder("Type") %></td>
<td><%= rsNewOrder("Color") %></td>
<td><%= rsNewOrder("Type") %></td>
<%
wend

set rsNewOrder = nothing
cn.Close()
%>
</tr></table>
</body>
</html>
__________________
"Everything is possible, somethings are just less likely then others"
Reply With Quote
  #2 (permalink)  
Old 10-20-03, 15:11
ghornet ghornet is offline
Registered User
 
Join Date: Jul 2003
Posts: 23
Got it

Ok I have been staring at code for way to long... I forgot to put in a MoveNext Command.. lesson learned... Next!
__________________
"Everything is possible, somethings are just less likely then others"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On