title: Automatically change Page after 10 Seconds (ASP Classic)
body: <p>I have an Active Server Page, which displays Booking of the current Day. I setted the PageSize to two, so my display is displaying just 2 bookings per side, if there are more Records.
  So actually i have 8 bookings in my Recordset, so my ASP creates 4 Pages. </p>
  
  <p>To illustrate it, i have done a snapshot. </p>
  
  <p><a href="http://i46.tinypic.com/351j2bk.png" rel="nofollow">Display</a></p>
  
  <p>As you can see, there are 4 Pages and i can switch between them. With <code>&gt;</code> i get the next two bookings and with <code>&lt;</code> i can get the previous two bookings.</p>
  
  <p>What i need desperately is a automatically Change of the pages in 10 second intervall.
  For Example:  Display the first page for 10 seconds, then switch to the next page and display it for 10 seconds and so on. If the last Page has been reached, then start again from the first page.</p>
  
  <p>I think i need something like a Timer which changes the Page every 10 seconds and a loop which starts from the first page again if the last has been reached. But i don't know how to do that.</p>
  
  <p>I would be glad if someone could help me.</p>
  
  <p>Part of my Code so far:</p>
  
  <pre><code>Option Explicit
  'declare variables
  Dim Currpage, pageLen, lastNumber, PageRem, PageTen
  Dim connection, recordset, sSQL, sConnString, next10, prev10, P
  Dim RSPrevPage, RSNextPage, start
  Dim thema, rsRaum, displayanzeige, bstatus, raum_id, GebaeudeBezeichnung, HinweisText, KOPPELBESTUHLUNG_ID, raumname
  'Get the current page the user is on, if it's the first time they
  'visit and the variable 'PageNo' is empty, then 'CurrPage' gets set to 1
  'Else the current page variable 'CurrPage' is set to the page number requested
  If IsEmpty(Request.Querystring("PageNo")) then
  CurrPage = 1
  Else
  CurrPage = Cint(Request.Querystring("PageNo"))
  End If
  
  'the two functions below return the next 10 and prev 10 page number
  Function getNext10(num)
  pageLen = len(num)
  If pageLen = 1 Then
  next10 = 10
  ElseIf pageLen&gt;1 Then
  pageRem = 10
  pageTen = right(num, 1)
  next10 = num + pageRem - pageTen
  End If
  getNext10 = next10
  End Function
  
  Function getPrev10(num)
  pageLen = len(num)
  If pageLen = 1 then
  prev10 = 1
  ElseIf pageLen&gt;1 then
  lastNumber = right(num, 1)
  prev10 = num - lastNumber - 10
  End If
  If prev10 = 0 then
  prev10 = 1
  End If
  getPrev10 = prev10
  End Function
  
  
   Do Until Recordset.AbsolutePage &lt;&gt; CurrPage OR Recordset.Eof
  
  
   Recordset.MoveNext
   Loop
  
  
  'the next 2 lines setup the page number for the "previous" and "next" links
  RSNextPage = CurrPage + 1
  RSPrevPage = CurrPage -1
  
  'find out the number of pages returned in the recordset
  'if the Next10 page number is greater than the recordset page count
  'then set Next10 to the recordset pagecount
  If Next10 &gt; Recordset.PageCount Then
  Next10 = Recordset.PageCount
  End If
  
  'the variable start determines where to start the page number navigation
  ' i.e. 1, 10, 20, 30 and so on. 
  If prev10 = 1 AND next10 - 1 &lt; 10 Then
  start = 1
  Else
  start = Next10 - 10
  If right(start, 1) &gt; 0 Then
  start = replace(start, right(start, 1), "0")
  start = start + 10
  End If
  End If
  
  'This checks to make sure that there is more than one page of results
  If Recordset.PageCount &gt; 1 Then
  'Work out whether to show the Previous 10 '&lt;&lt;' 
  If currpage &gt; 1 Then
  response.write("&lt;a href=""paging.asp?PageNo=" &amp; Prev10 &amp; """&gt;&lt;&lt;&lt;/a&gt; ")
  End If
  'Work out whether to show the Previous link '&lt;' 
  If NOT RSPrevPage = 0 then
  response.write("&lt;a href=""paging.asp?PageNo=" &amp; RSPrevPage &amp; """&gt;&lt;&lt;/a&gt; ")
  End If
  
  'Loop through the page number navigation using P as our loopcounter variable 
  For P = start to Next10
  
  If NOT P = CurrPage then
  response.write("&lt;a href=""paging.asp?PageNo=" &amp; P &amp; """&gt;" &amp; P &amp; "&lt;/a&gt; ")
  Else
  'Don't hyperlink the current page number 
  response.write(" &lt;b&gt;" &amp; P &amp; " &lt;/b&gt;")
  End If
  Next
  'this does the same as the "previous" link, but for the "next" link
  If NOT RSNextPage &gt; Recordset.PageCount Then
  response.write("&lt;a href=""paging.asp?PageNo=" &amp; RSNextPage &amp; """&gt;&gt;&lt;/a&gt; ")
  End If
  
  'Work out whether to show the Next 10 '&gt;&gt;' 
  If NOT Next10 = Recordset.PageCount Then
  response.write(" &lt;a href=""paging.asp?PageNo=" &amp; Next10 &amp; """&gt;&gt;&gt;&lt;/a&gt;")
  End If
  </code></pre>