Classic ASP Looping: if statement not working

I started develping in classic ASP a few years ago and have just been asked to revisit an application I created.  Well, I'm trying to dust off the shelves of my ASP knowledge but for some reason I can't get this "if statement" to return true while looping through the returned recordset.  Here's what's outputed to the browser from the attached code:

bad*****1||1
bad*****2||1
bad*****3||1
bad*****4||1
bad*****5||1
bad*****6||1
bad*****638||1
bad*****7||1
bad*****8||1
bad*****639||1

Why doesn't the first line return "good" (true)?  I know it's probably something very simple but I've spent an hour on this already and I don't have much more time to devote to it.
strsql = ""
	strsql = strsql & "SELECT TOP 10 siteid,site_name,address FROM sites ORDER BY site_name"
	'response.write strsql
	set rsSites = Server.CreateObject("ADODB.Recordset")
	set rsSites = dbConn.execute(strsql)
	
	if rsSites.EOF = True then
		response.write "No sites on file"
		response.end
	end if
 
	siteArray = rsSites.Getrows()
	'Name fields
	Const siteid = 0
	Const site_name = 1
	Const address = 2
		
	rsSites.close
	set rsSites = nothing	
	
	for irowloop = 0 to ubound(siteArray,2)
		selected = ""
		if (siteArray(siteid,irowloop)) = request.querystring("id") Then
			response.write "good"
		else 
			response.write "bad"
		end if
		response.write "*****"&(siteArray(siteid,irowloop))&"||"&request.querystring("id")&"<br>"
	next

Open in new window

wcotechAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

R_HarrisonCommented:
Suspect it is to do with one value being numeric and the other text, try swapping the line

if (siteArray(siteid,irowloop)) = request.querystring("id") Then

with

if cdbl((siteArray(siteid,irowloop)))= cdbl(request.querystring("id")) Then
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GawaiCommented:
change
if rsSites.EOF = True then
            response.write "No sites on file"
            response.end
      end if
 


to

if rsSites.EOF  then
            response.write "No sites on file"
            response.end
      end if
 
0
wcotechAuthor Commented:
Beautiful!  I knew it was something simple.  Thanks for your help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.