<% dim rst, strSQL, Txt, cnt, Colour, noOfRecords, noOfPages, cntPageCount, startPage, endPage, imgHeight, imgWidth 'Create the Recordset object set Rst = server.CreateObject("ADOR.Recordset") set RstCount = server.CreateObject("ADOR.Recordset") 'Open the connection to the database 'Conn.Open strCon if Request.QueryString ("startPage") = "" then startPage = 0 else startPage = Request.QueryString ("startPage") end if if Request.QueryString ("startPage") = "" then endPage = 5 else endPage = Request.QueryString ("endPage") end if strSQL = "SELECT COUNT(*) FROM NEWS" rst.CursorLocation = aduseserver rst.open strsql,conn noOfRecords = rst.Fields (0) rst.Close strSQL = "SELECT News.* FROM News WHERE (((News.NEWSID) > " & startPage & " and (News.NEWSID)<= " & endPage & "))" rst.open strsql,conn imgHeight=120 imgWidth=150 If rst.EOF = false then 'noOfRecords = rst.RecordCount rst.MoveFirst if noOfRecords > 5 then noOfPages = noOfRecords / 5 else noOfPages = 1 end if End if %>
 
<% if not rst.EOF then %> <% if rst.Fields ("Image") <> "" then %> <% else %> <% end if %> <% rst.MoveNext end if %> <% if not rst.EOF then %> <% if rst.Fields ("Image") <> "" then %> <% else %> <% end if %> <% rst.MoveNext end if %>
  <% Response.Write(rst.Fields ("Title")) %>
align="right" border="0">
Press Image" width="<% = imgWidth %>"/>

<%Response.Write(left(rst.Fields ("Text"),400))%>

<% Response.Write(left(rst.Fields ("Text"),400)) %>
', '570', '570' );" href="../news/article.asp?NewsID=<%Response.Write (rst.Fields ("NEWSID")) %> ">Click to view
  <% Response.Write(rst.Fields ("Title")) %>
align="right" border="0">
Press Image" width="<% = imgWidth %>"/>

<%Response.Write(left(rst.Fields ("Text"),400))%>

<% Response.Write(left(rst.Fields ("Text"),400)) %>
', '570', '570' );" href="../news/article.asp?NewsID=<%Response.Write (rst.Fields ("NEWSID")) %> ">Click to view
<% if not rst.EOF then %> <% if rst.Fields ("Image") <> "" then %> <% else %> <% end if %> <% rst.MoveNext end if %> <% if not rst.EOF then %> <% if rst.Fields ("Image") <> "" then %> <% else %> <% end if %> <% rst.MoveNext end if if not rst.EOF then %> <% if rst.Fields ("Image") <> "" then %> <% else %> <% end if %> <% end if %>
  <% Response.Write(rst.Fields ("Title")) %>
align="right" border="0">
Press Image" width="<% = imgWidth %>"/>

<%Response.Write(left(rst.Fields ("Text"),400))%>

<% Response.Write(left(rst.Fields ("Text"),400)) %>
', '570', '570' );" href="../news/article.asp?NewsID=<%Response.Write (rst.Fields ("NEWSID")) %> ">Click to view
  <% Response.Write(rst.Fields ("Title")) %>
align="right" border="0">
Press Image" width="<% = imgWidth %>"/>

<%Response.Write(left(rst.Fields ("Text"),400))%>

<% Response.Write(left(rst.Fields ("Text"),400)) %>
', '570', '570' );" href="../news/article.asp?NewsID=<%Response.Write (rst.Fields ("NEWSID")) %> ">Click to view
  <% Response.Write(rst.Fields ("Title")) %>
align="right" border="0"> <% Response.Write (rst.Fields ("Image")) %>
">Press Image" width="<% = imgWidth %>"/>

<%Response.Write(left(rst.Fields ("Text"),400))%>

<% Response.Write(left(rst.Fields ("Text"),400)) %>
', '570', '570' );" href="../news/article.asp?NewsID=<%Response.Write (rst.Fields ("NEWSID")) %> ">Click to view
 
 
<% dim i j = 1 for i = 0 to noOfRecords step 5 %> <% =Response.Write (j) %> <% j = j +1 next %>
<% rst.Close %>