Looster
Feb 13th, 2001, 10:48 PM
Hey guy's
Here's my code:
************
Set rsResults = conn.Execute("SELECT * FROM Headlines WHERE Head_Date = '" & lcdate & "' ORDER By Head_Index Desc")
if not rsResults.EOF then
Response.Write "</blockquote><font face=""times new roman"" size=""5"" color=""#000000"">Today's Top Stories.</font><blockquote><ul type=""disc"">"
Do
if cstr(rsResults("Head_Date")) = lcdate then
Response.Write "<li><a href=""javascript:Head('http://www.newsclip.co.za/asp/headline.asp?sHead=" & rsResults("Head_Index") & "')""><font face=""times new roman"" size=""3"" color=""RED"">" & rsResults("Head_Headline") & " <br> " & rsResults("Head_Time") & "</font></a>"
i = i + 1
rsResults.MoveNext()
else
Response.write "Error Retriving Data.<br>"
end if
Loop While i <> 4 'OR rsResults.EOF = True
end if
*******************
My problem is that if I have less than 3 headlines to be added I get an error message Now I want to loop to run 3 times or until the end of the Recordset has been reached but It doesn't want to work that way.
Thanks in advance
Here's my code:
************
Set rsResults = conn.Execute("SELECT * FROM Headlines WHERE Head_Date = '" & lcdate & "' ORDER By Head_Index Desc")
if not rsResults.EOF then
Response.Write "</blockquote><font face=""times new roman"" size=""5"" color=""#000000"">Today's Top Stories.</font><blockquote><ul type=""disc"">"
Do
if cstr(rsResults("Head_Date")) = lcdate then
Response.Write "<li><a href=""javascript:Head('http://www.newsclip.co.za/asp/headline.asp?sHead=" & rsResults("Head_Index") & "')""><font face=""times new roman"" size=""3"" color=""RED"">" & rsResults("Head_Headline") & " <br> " & rsResults("Head_Time") & "</font></a>"
i = i + 1
rsResults.MoveNext()
else
Response.write "Error Retriving Data.<br>"
end if
Loop While i <> 4 'OR rsResults.EOF = True
end if
*******************
My problem is that if I have less than 3 headlines to be added I get an error message Now I want to loop to run 3 times or until the end of the Recordset has been reached but It doesn't want to work that way.
Thanks in advance