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

Server goes berserk over ADO SQL query in ASP script. 1

Status
Not open for further replies.

Eldaria

Programmer
Sep 20, 2001
123
NL
HI all, I have a real strange problem, I have created an ASP page to show an index over movies that I have, but It makes my server go berserk, a process called DLLHOST starts using 95-100% CPU and eats huge amount of memory as soon as I try to open the page.
The page is timing out after a while and never shows any results.

Here is the code for the page.
Description of problem on the end.

--- Start of Script ---
Code:
<html>
<head>
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/style.css&quot; />
<title>Eldaria Movie Zone</title>
</head>
<p align=&quot;center&quot;><img src=&quot;/images/moviezone.jpg&quot; alt=&quot;Eldaria Movie Zone Logo&quot;></p>
<p><h3>Welcome to Eldaria Movie Zone.</h3></p>
<b><u>Please select a letter:</u></b><br>
<%
set conn=Server.CreateObject(&quot;ADODB.Connection&quot;)
Constr=&quot;DRIVER={SQL Server};SERVER=**hidden**;UID=**hidden**;PWD=**hidden**;DATABASE=MovieIndex&quot;
conn.Open Constr
set rs=Server.CreateObject(&quot;ADODB.recordset&quot;)
set rs2=Server.CreateObject(&quot;ADODB.recordset&quot;)
select case request.querystring(&quot;Alphab&quot;)
	case &quot;&quot;
		rs.open &quot;SELECT tbl_Movie.Title FROM tbl_Movie ORDER BY tbl_Movie.Title&quot;, conn
		response.write(&quot;- &quot;)
		do until rs.eof
			PrLetter = FiLetter
			FiLetter = left(rs.fields(&quot;Title&quot;).value,1)
			If PrLetter = FiLetter then
				rs.movenext
			else
				response.write(&quot;<a class='two' href='browse.asp?Alphab=&quot; & FiLetter & &quot;'><b>&quot; & Filetter & &quot;</a> - </b>&quot;)
			end if
		loop
	case else
		rs.open &quot;SELECT tbl_Movie.Title FROM tbl_Movie ORDER BY tbl_Movie.Title&quot;, conn
		response.write(&quot;- &quot;)
		do until rs.eof
			PrLetter = FiLetter
			FiLetter = left(rs.fields(&quot;Title&quot;).value,1)
			If PrLetter = FiLetter then
				rs.movenext
			else
				response.write(&quot;<a class='two' href='browse.asp?Alphab=&quot; & FiLetter & &quot;'><b>&quot; & Filetter & &quot;</a> - </b>&quot;)
			end if
		loop
		response.write(&quot;<br><br><b><u>Or Select the movie you want more information about:</u></b><br>&quot;)
		qstr = request.querystring(&quot;Alphab&quot;)
		response.write(&quot;<br>&quot; & qstr & &quot;<br>&quot;)
		rs2.open &quot;SELECT MovieID, Title, LEFT(Title, 1) AS Letter FROM tbl_Movie WHERE (LEFT(Title, 1) = '&quot; & qstr & &quot;')&quot;, conn
		do until rs2.eof
			response.write(rs2.fields(&quot;Title&quot;).value)
		loop
end select
%>
</html>
--- End of Script ---

The problem is for sure with the last lines opening the rs2 recordset.
If I remove the lines for rs2 the script runs smooth, but is of cource not performing what it should.

A note should be that at the moment there are only 30 records, so I can not see that it should be the amount of records it opens.

I tried to run the SQL query directly in the SQL Manager on the server and there it runs fine and shows the records.

And as you can see ther is hardly any difference between rs and rs2 in the script. it opens the same amount of records, well actually, rs opens all of them while rs2 only opens selected records.

Any help would be higly appreciated.
Kind regards.
Brian.
Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 
Where are your MoveNext commands for your recordsets?

In your &quot;If PrLetter = FiLetter&quot; statements for rs, the else clause has no MoveNext. Neither does your rs2 loop.
 
LOL , Me=Stupid...

Thanks a lot.. hehe...

Brian.
Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 
No Worries,
I used to use testing as a guaranteed cigarette break because I always managed to forget putting the MoveNext in a piece if code the first time around, so while the development was grinding away for a minute and a half I was out back enjoying a &quot;forced&quot; break until the machine became useable again :)
-Tarwn &quot;If you eat a live toad first thing in the morning, nothing worse will happen all day long.&quot; - California saying
&quot;To you or the toad&quot; - Niven's restatement of California saying
&quot;-well most of the time anyway...&quot; - programmers caveat to Niven's restatement of California saying
(The Wiz Biz - Ri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top