Reply
Choosing either form using the while statement
Old 05-28-2009, 01:18 PM Choosing either form using the while statement
Average Talker

Posts: 25
Trades: 0
I am stuck with this. If a number is after 5 then it goes to the other form but if it is before the number 5 it is goes to the first form. Here is the code.

rs.Open sqlstatement, connection

While Not rs.EOF
response.write "<tr>"
response.write "<td> "& rs.Fields("NAME") &" </td>"
response.write "<td><a href=testforms.asp?class_code="& class_encoded &"&amp;number="& rs.Fields("number") &">"& rs.Fields("CODE") &"</a></td>"
response.write "<td>"& rs.Fields("number") &"</td>"
response.write "<td>"& rs.Fields("campid") &"</td>"

if Session("Number") >= 5 then

response.write "<tr>"
response.write "<td> "& rs.Fields("NAME") &" </td>"
response.write "<td><a href=testenew.asp?class_code="& class_encoded &"&amp;number="& rs.Fields("NUMBER") &">"& rs.Fields("CODE") &"</a></td>"
response.write "<td>"& rs.Fields("number") &"</td>"
response.write "<td>"& rs.Fields("campid") &"</td>"
response.write "</tr>"
end if
' loop
rs.MoveNext
wend
tgmiller5 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 05-30-2009, 12:00 PM Re: Choosing either form using the while statement
Experienced Talker

Posts: 30
Name: Kulrom
Location: Republic of Macedonia
Trades: 0
And how do you increment the session object?
You seem to be missing the portion Session("Number") += 1 in the While block.
Otherwise please be more specific

Last edited by Kulrom; 05-30-2009 at 12:09 PM..
Kulrom is offline
Reply With Quote
View Public Profile Visit Kulrom's homepage!
 
Old 05-31-2009, 06:21 AM Re: Choosing either form using the while statement
Experienced Talker

Posts: 30
Name: Kulrom
Location: Republic of Macedonia
Trades: 0
hey Mods .. are you following this guy? Please take care of this mortgage adverts.
Kulrom is offline
Reply With Quote
View Public Profile Visit Kulrom's homepage!
 
Old 06-02-2009, 03:44 AM Re: Choosing either form using the while statement
harish's Avatar
Average Talker

Posts: 26
Name: Harish kumar
Trades: 0
try this code hope this code will work..

Code:
<% 
dim number=0
While Not rs.EOF
response.write "<tr>"
response.write "<td> "& rs.Fields("NAME")  &" </td>"
response.write "<td><a href=testforms.asp?class_code="& class_encoded &"&amp;number="& rs.Fields("number") &">"& rs.Fields("CODE") &"</a></td>"
response.write "<td>"& rs.Fields("number")  &"</td>"
response.write "<td>"& rs.Fields("campid")  &"</td>"
 
if Session("Number") >= 5 then 

response.write "<tr>"
response.write "<td> "& rs.Fields("NAME")  &" </td>"
response.write "<td><a href=testenew.asp?class_code="& class_encoded &"&amp;number="& rs.Fields("NUMBER") &">"& rs.Fields("CODE") &"</a></td>"
response.write "<td>"& rs.Fields("number")  &"</td>"
response.write "<td>"& rs.Fields("campid")  &"</td>"
response.write "</tr>"
end if 
number=number+1
  wend
rs.MoveNext

%>
harish is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Choosing either form using the while statement
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.11144 seconds with 13 queries