suantaik
15 Jan 2006, 07:22 PM
I need some help writing an IF statement for ASP. Perhaps an IF statement isn't the best choice here, I'm not really sure. Basically I am outputting a list of dealers for our website. Due to the design of the page, I need to change the table column properties in the last record so that it is different from the rows above it. Here's the code I have so far. I can't seem to get this to work though. It will output everything except the last record. How do I create a conditional output like this? Is an IF statement even the correct approach here?
<%
SQL_query = "SELECT * FROM dealerpage WHERE Region = 'North America' "
Set RS = MyConn.Execute(SQL_query)
IF NOT RS.EOF THEN
Response.Write "<tr><td><p align='left'><a href=' " & Rs("PageURL") & " '><b>" & rs("Country") & "</b></a></p></td></tr>"
RS.MoveNext
ELSE
Response.Write "<tr><td class='last'><p align='left'><a href=' " & Rs("PageURL") & " '><b>" & rs("Country") & "</b></a></p></td></tr>"
RS.MoveNext
END IF
%>
<%
SQL_query = "SELECT * FROM dealerpage WHERE Region = 'North America' "
Set RS = MyConn.Execute(SQL_query)
IF NOT RS.EOF THEN
Response.Write "<tr><td><p align='left'><a href=' " & Rs("PageURL") & " '><b>" & rs("Country") & "</b></a></p></td></tr>"
RS.MoveNext
ELSE
Response.Write "<tr><td class='last'><p align='left'><a href=' " & Rs("PageURL") & " '><b>" & rs("Country") & "</b></a></p></td></tr>"
RS.MoveNext
END IF
%>