|
 |
asp_web_howto thread: do while not rs.eof
Message #1 by "Joe" <joe@k...> on Thu, 14 Feb 2002 13:11:05
|
|
Could someone have a quick look over this code for me. I'm pulling my hair
out in large chuncks!!
<%
do while not rs.eof
if rs("CatergoryID") = request.querystring("CatergoryID") then
response.write("<TR> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG SRC=""i.gif""
WIDTH=""23"" HEIGHT=""23"" BORDER=""0"" NAME=""i"&rs("CatergoryID")
&"""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""> <A
HREF=""cemented_stems.htm"" ONMOUSEOVER=""vashnaRoll('i"&rs("CatergoryID")
&"','i_over.gif');"" ONMOUSEOUT=""vashnaRoll('i"&rs("CatergoryID")
&"','i.gif');"">"&rs("CatergoryDescription")&"</A></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""></TD> ")
response.write("</TR> ")
else
response.write("<TR> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG
SRC=""../main_graphics/spacer.gif"" WIDTH=""1"" HEIGHT=""5""></TD> ")
response.write("<TD ALIGN=""RIGHT"" VALIGN=""MIDDLE""><IMG
SRC=""line.gif"" WIDTH=""62"" HEIGHT=""23""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG SRC=""i.gif""
WIDTH=""23"" HEIGHT=""23"" BORDER=""0"" NAME=""i"&rs("CatergoryID")
&"""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""> <A HREF=""#""
ONMOUSEOVER=""vashnaRoll('i"&rs("CatergoryID")&"','i_over.gif');""
ONMOUSEOUT=""vashnaRoll('i"&rs("CatergoryID")&"','i.gif');"">"&rs
("CatergoryDescription")&"</A></TD> ")
response.write("</TR> ")
end if
rs.movenext
loop
rs.close
set rs = nothing
%>
This is the line that's giving me jip:
if rs("CatergoryID") = request.querystring("CatergoryID") then etc. etc.
If I response.write the request.querystring I'm getting the value, let's
say 3, if I hard code the value i.e:
if rs("CatergoryID") = 3 then etc. etc.
again, all is OK, but if I try to insert as a variable it's not working!
Do this have something to do with 'do while not rs.eof'?
Any help would be greatfully appreciated.
Joe
Message #2 by "Peter Rooney" <peter.rooney@p...> on Thu, 14 Feb 2002 13:25:22 -0000
|
|
Joe put the Request into a variable first and make sure it is seen as an
integer:
REQUESID = CInt(request.querystring("CatergoryID"))
if rs("CatergoryID") = REQUESID then
The chances are that you are receiving an error because the Request value is
seen as a string not an integer
HTH
Peter
-----Original Message-----
From: Joe [mailto:joe@k...]
Sent: Thursday, February 14, 2002 1:11 PM
To: ASP Web HowTo
Subject: [asp_web_howto] do while not rs.eof
Could someone have a quick look over this code for me. I'm pulling my hair
out in large chuncks!!
<%
do while not rs.eof
if rs("CatergoryID") = request.querystring("CatergoryID") then
response.write("<TR> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG SRC=""i.gif""
WIDTH=""23"" HEIGHT=""23"" BORDER=""0"" NAME=""i"&rs("CatergoryID")
&"""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""> <A
HREF=""cemented_stems.htm"" ONMOUSEOVER=""vashnaRoll('i"&rs("CatergoryID")
&"','i_over.gif');"" ONMOUSEOUT=""vashnaRoll('i"&rs("CatergoryID")
&"','i.gif');"">"&rs("CatergoryDescription")&"</A></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""></TD> ")
response.write("</TR> ")
else
response.write("<TR> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG
SRC=""../main_graphics/spacer.gif"" WIDTH=""1"" HEIGHT=""5""></TD> ")
response.write("<TD ALIGN=""RIGHT"" VALIGN=""MIDDLE""><IMG
SRC=""line.gif"" WIDTH=""62"" HEIGHT=""23""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG SRC=""i.gif""
WIDTH=""23"" HEIGHT=""23"" BORDER=""0"" NAME=""i"&rs("CatergoryID")
&"""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""> <A HREF=""#""
ONMOUSEOVER=""vashnaRoll('i"&rs("CatergoryID")&"','i_over.gif');""
ONMOUSEOUT=""vashnaRoll('i"&rs("CatergoryID")&"','i.gif');"">"&rs
("CatergoryDescription")&"</A></TD> ")
response.write("</TR> ")
end if
rs.movenext
loop
rs.close
set rs = nothing
%>
This is the line that's giving me jip:
if rs("CatergoryID") = request.querystring("CatergoryID") then etc. etc.
If I response.write the request.querystring I'm getting the value, let's
say 3, if I hard code the value i.e:
if rs("CatergoryID") = 3 then etc. etc.
again, all is OK, but if I try to insert as a variable it's not working!
Do this have something to do with 'do while not rs.eof'?
Any help would be greatfully appreciated.
Joe
$subst('Email.Unsub').
Message #3 by Joe Ingle <Joe@k...> on Thu, 14 Feb 2002 01:13:19 -0000
|
|
Peter, your a star. I hade put it into a variable, but that wasn't working.
Identifying it as an integer has worked a treat though.
Many thanks
-----Original Message-----
From: Peter Rooney [mailto:peter.rooney@p...]
Sent: Thursday, February 14, 2002 01:25
To: ASP Web HowTo
Subject: [asp_web_howto] RE: do while not rs.eof
Joe put the Request into a variable first and make sure it is seen as an
integer:
REQUESID = CInt(request.querystring("CatergoryID"))
if rs("CatergoryID") = REQUESID then
The chances are that you are receiving an error because the Request value is
seen as a string not an integer
HTH
Peter
-----Original Message-----
From: Joe [mailto:joe@k...]
Sent: Thursday, February 14, 2002 1:11 PM
To: ASP Web HowTo
Subject: [asp_web_howto] do while not rs.eof
Could someone have a quick look over this code for me. I'm pulling my hair
out in large chuncks!!
<%
do while not rs.eof
if rs("CatergoryID") = request.querystring("CatergoryID") then
response.write("<TR> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG SRC=""i.gif""
WIDTH=""23"" HEIGHT=""23"" BORDER=""0"" NAME=""i"&rs("CatergoryID")
&"""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""> <A
HREF=""cemented_stems.htm"" ONMOUSEOVER=""vashnaRoll('i"&rs("CatergoryID")
&"','i_over.gif');"" ONMOUSEOUT=""vashnaRoll('i"&rs("CatergoryID")
&"','i.gif');"">"&rs("CatergoryDescription")&"</A></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""></TD> ")
response.write("</TR> ")
else
response.write("<TR> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG
SRC=""../main_graphics/spacer.gif"" WIDTH=""1"" HEIGHT=""5""></TD> ")
response.write("<TD ALIGN=""RIGHT"" VALIGN=""MIDDLE""><IMG
SRC=""line.gif"" WIDTH=""62"" HEIGHT=""23""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG SRC=""i.gif""
WIDTH=""23"" HEIGHT=""23"" BORDER=""0"" NAME=""i"&rs("CatergoryID")
&"""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""> <A HREF=""#""
ONMOUSEOVER=""vashnaRoll('i"&rs("CatergoryID")&"','i_over.gif');""
ONMOUSEOUT=""vashnaRoll('i"&rs("CatergoryID")&"','i.gif');"">"&rs
("CatergoryDescription")&"</A></TD> ")
response.write("</TR> ")
end if
rs.movenext
loop
rs.close
set rs = nothing
%>
This is the line that's giving me jip:
if rs("CatergoryID") = request.querystring("CatergoryID") then etc. etc.
If I response.write the request.querystring I'm getting the value, let's
say 3, if I hard code the value i.e:
if rs("CatergoryID") = 3 then etc. etc.
again, all is OK, but if I try to insert as a variable it's not working!
Do this have something to do with 'do while not rs.eof'?
Any help would be greatfully appreciated.
Joe
$subst('Email.Unsub').
$subst('Email.Unsub').
Message #4 by Oleg Kapeljushnik <c-oleg.kapeljushnik@w...> on Thu, 14 Feb 2002 09:12:07 -0500
|
|
Try to assign request.querystring("CatergoryID") to some variable
and then use this variable in your if statement.
Oleg
-----Original Message-----
From: Joe [mailto:joe@k...]
Sent: February 14, 2002 1:11 PM
To: ASP Web HowTo
Subject: [asp_web_howto] do while not rs.eof
Could someone have a quick look over this code for me. I'm pulling my hair
out in large chuncks!!
<%
do while not rs.eof
if rs("CatergoryID") = request.querystring("CatergoryID") then
response.write("<TR> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG SRC=""i.gif""
WIDTH=""23"" HEIGHT=""23"" BORDER=""0"" NAME=""i"&rs("CatergoryID")
&"""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""> <A
HREF=""cemented_stems.htm"" ONMOUSEOVER=""vashnaRoll('i"&rs("CatergoryID")
&"','i_over.gif');"" ONMOUSEOUT=""vashnaRoll('i"&rs("CatergoryID")
&"','i.gif');"">"&rs("CatergoryDescription")&"</A></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""></TD> ")
response.write("</TR> ")
else
response.write("<TR> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG
SRC=""../main_graphics/spacer.gif"" WIDTH=""1"" HEIGHT=""5""></TD> ")
response.write("<TD ALIGN=""RIGHT"" VALIGN=""MIDDLE""><IMG
SRC=""line.gif"" WIDTH=""62"" HEIGHT=""23""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG SRC=""i.gif""
WIDTH=""23"" HEIGHT=""23"" BORDER=""0"" NAME=""i"&rs("CatergoryID")
&"""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""> <A HREF=""#""
ONMOUSEOVER=""vashnaRoll('i"&rs("CatergoryID")&"','i_over.gif');""
ONMOUSEOUT=""vashnaRoll('i"&rs("CatergoryID")&"','i.gif');"">"&rs
("CatergoryDescription")&"</A></TD> ")
response.write("</TR> ")
end if
rs.movenext
loop
rs.close
set rs = nothing
%>
This is the line that's giving me jip:
if rs("CatergoryID") = request.querystring("CatergoryID") then etc. etc.
If I response.write the request.querystring I'm getting the value, let's
say 3, if I hard code the value i.e:
if rs("CatergoryID") = 3 then etc. etc.
again, all is OK, but if I try to insert as a variable it's not working!
Do this have something to do with 'do while not rs.eof'?
Any help would be greatfully appreciated.
Joe
$subst('Email.Unsub').
Message #5 by Joe Ingle <Joe@k...> on Thu, 14 Feb 2002 01:58:10 -0000
|
|
Cheers Oleg
I've resolved this by identifying the variable as an interger. i.e:
CatergoryID = CInt(request.querystring("CatergoryID"))
Thanks anyway.
Joe
-----Original Message-----
From: Oleg Kapeljushnik [mailto:c-oleg.kapeljushnik@w...]
Sent: Thursday, February 14, 2002 02:12
To: ASP Web HowTo
Subject: [asp_web_howto] RE: do while not rs.eof
Try to assign request.querystring("CatergoryID") to some variable
and then use this variable in your if statement.
Oleg
-----Original Message-----
From: Joe [mailto:joe@k...]
Sent: February 14, 2002 1:11 PM
To: ASP Web HowTo
Subject: [asp_web_howto] do while not rs.eof
Could someone have a quick look over this code for me. I'm pulling my hair
out in large chuncks!!
<%
do while not rs.eof
if rs("CatergoryID") = request.querystring("CatergoryID") then
response.write("<TR> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG SRC=""i.gif""
WIDTH=""23"" HEIGHT=""23"" BORDER=""0"" NAME=""i"&rs("CatergoryID")
&"""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""> <A
HREF=""cemented_stems.htm"" ONMOUSEOVER=""vashnaRoll('i"&rs("CatergoryID")
&"','i_over.gif');"" ONMOUSEOUT=""vashnaRoll('i"&rs("CatergoryID")
&"','i.gif');"">"&rs("CatergoryDescription")&"</A></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""></TD> ")
response.write("</TR> ")
else
response.write("<TR> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG
SRC=""../main_graphics/spacer.gif"" WIDTH=""1"" HEIGHT=""5""></TD> ")
response.write("<TD ALIGN=""RIGHT"" VALIGN=""MIDDLE""><IMG
SRC=""line.gif"" WIDTH=""62"" HEIGHT=""23""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG SRC=""i.gif""
WIDTH=""23"" HEIGHT=""23"" BORDER=""0"" NAME=""i"&rs("CatergoryID")
&"""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""> <A HREF=""#""
ONMOUSEOVER=""vashnaRoll('i"&rs("CatergoryID")&"','i_over.gif');""
ONMOUSEOUT=""vashnaRoll('i"&rs("CatergoryID")&"','i.gif');"">"&rs
("CatergoryDescription")&"</A></TD> ")
response.write("</TR> ")
end if
rs.movenext
loop
rs.close
set rs = nothing
%>
This is the line that's giving me jip:
if rs("CatergoryID") = request.querystring("CatergoryID") then etc. etc.
If I response.write the request.querystring I'm getting the value, let's
say 3, if I hard code the value i.e:
if rs("CatergoryID") = 3 then etc. etc.
again, all is OK, but if I try to insert as a variable it's not working!
Do this have something to do with 'do while not rs.eof'?
Any help would be greatfully appreciated.
Joe
$subst('Email.Unsub').
$subst('Email.Unsub').
Message #6 by "O'Hara, Elliott M" <EMOHARA@k...> on Thu, 14 Feb 2002 12:58:28 -0500
|
|
hence the name
querySTRING
;o)
I only joke because I've made teh same mistake...
:o)
-----Original Message-----
From: Joe Ingle [mailto:Joe@k...]
Sent: Wednesday, February 13, 2002 8:58 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: do while not rs.eof
Cheers Oleg
I've resolved this by identifying the variable as an interger. i.e:
CatergoryID = CInt(request.querystring("CatergoryID"))
Thanks anyway.
Joe
-----Original Message-----
From: Oleg Kapeljushnik [mailto:c-oleg.kapeljushnik@w...]
Sent: Thursday, February 14, 2002 02:12
To: ASP Web HowTo
Subject: [asp_web_howto] RE: do while not rs.eof
Try to assign request.querystring("CatergoryID") to some variable
and then use this variable in your if statement.
Oleg
-----Original Message-----
From: Joe [mailto:joe@k...]
Sent: February 14, 2002 1:11 PM
To: ASP Web HowTo
Subject: [asp_web_howto] do while not rs.eof
Could someone have a quick look over this code for me. I'm pulling my hair
out in large chuncks!!
<%
do while not rs.eof
if rs("CatergoryID") = request.querystring("CatergoryID") then
response.write("<TR> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG SRC=""i.gif""
WIDTH=""23"" HEIGHT=""23"" BORDER=""0"" NAME=""i"&rs("CatergoryID")
&"""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""> <A
HREF=""cemented_stems.htm"" ONMOUSEOVER=""vashnaRoll('i"&rs("CatergoryID")
&"','i_over.gif');"" ONMOUSEOUT=""vashnaRoll('i"&rs("CatergoryID")
&"','i.gif');"">"&rs("CatergoryDescription")&"</A></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""></TD> ")
response.write("</TR> ")
else
response.write("<TR> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG
SRC=""../main_graphics/spacer.gif"" WIDTH=""1"" HEIGHT=""5""></TD> ")
response.write("<TD ALIGN=""RIGHT"" VALIGN=""MIDDLE""><IMG
SRC=""line.gif"" WIDTH=""62"" HEIGHT=""23""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""><IMG SRC=""i.gif""
WIDTH=""23"" HEIGHT=""23"" BORDER=""0"" NAME=""i"&rs("CatergoryID")
&"""></TD> ")
response.write("<TD ALIGN=""LEFT"" VALIGN=""MIDDLE""> <A HREF=""#""
ONMOUSEOVER=""vashnaRoll('i"&rs("CatergoryID")&"','i_over.gif');""
ONMOUSEOUT=""vashnaRoll('i"&rs("CatergoryID")&"','i.gif');"">"&rs
("CatergoryDescription")&"</A></TD> ")
response.write("</TR> ")
end if
rs.movenext
loop
rs.close
set rs = nothing
%>
This is the line that's giving me jip:
if rs("CatergoryID") = request.querystring("CatergoryID") then etc. etc.
If I response.write the request.querystring I'm getting the value, let's
say 3, if I hard code the value i.e:
if rs("CatergoryID") = 3 then etc. etc.
again, all is OK, but if I try to insert as a variable it's not working!
Do this have something to do with 'do while not rs.eof'?
Any help would be greatfully appreciated.
Joe
$subst('Email.Unsub').
$subst('Email.Unsub').
$subst('Email.Unsub').
|
|
 |