Script: Paginação 1 2 3 [4] 5 6 : Funciona também no MySQL

Agência OFF, desenvolvimento de soluções web para as Agências Digitais

Para o bem de todos segue a Paginação que funciona no MySQL, Testada e Aprovada
LEGENDAS:

TedkDados => RS
TedKBanco => Conn
TedkDados.Pagesize = 30 => Quantidade de linhas!

  1.  
  2. <%
  3. TedkBanco.CursorLocation = 3
  4. Set TedkDados = Server.CreateObject( "Adodb.RecordSet")
  5. TedkDados.Pagesize = 30
  6. TedkDados.Open "Select NomeNewsletterEMail, EMailNewsletterEMail From adminNewsletterEMail Order By NomeNewsletterEMail Asc",TedkBanco
  7.  
  8. If TedkDados.Eof Then
  9. Response.Write("")
  10. Else
  11.  
  12. PaginaAtual = CInt(Request.Querystring( "Pages"))
  13.  
  14. If PaginaAtual = 0 Then
  15. PaginaAtual = 1
  16. End If
  17.  
  18. TedkDados.AbsolutePage = PaginaAtual
  19. Num = TedkDados.PageCount
  20.  
  21. While Not TedkDados.Eof And TedkDados.AbsolutePage = PaginaAtual
  22. % >
  23.  
  24. <%
  25. TedkDados.MoveNext : Wend
  26. Anterior = PaginaAtual – 1
  27. Proximo = PaginaAtual + 1
  28.  
  29. If Anterior <= 0 Then
  30. Anterior = 1
  31. End If
  32.  
  33. If Proximo > TedkDados.PageCount Then
  34. Proximo = TedkDados.PageCount
  35. End If
  36. % >
  37.  
  38. <table border="0" cellpadding="0" cellspacing="2" width="100%"><tbody>
  39. <tr>
  40. <td class="classFonte01" bgcolor="#ebebeb" height="30" width="44%"><strong>Nome</strong></td>
  41. <td class="classFonte01" bgcolor="#ebebeb" width="47%"><strong>E-Mail</strong></td>
  42. </tr>
  43. <tr>
  44. <td class="classFonte01" bgcolor="#f7f7f7" height="22"><% Response.Write(TedkDados("NomeNewsletterEMail")) %></td>
  45. <td class="classFonte01" bgcolor="#f7f7f7"><% Response.Write(TedkDados("EMailNewsletterEMail")) %></td>
  46. </tr>
  47. <tr>
  48. <td colspan="2" class="classFonte01" align="right" bgcolor="#ebebeb" height="30"><strong>Paginas:</strong> <%
  49. Jo = 1
  50. While Jo <= TedkDados.PageCountIf PaginaAtual = Jo Then
  51. Response.Write( "["&Jo&"]  ")
  52. Else
  53. Response.Write( "<a default.asp?pages="&Jo&">"&Jo&"</a>  ")
  54. End IfJo = Jo + 1
  55. Wend
  56. End If
  57. %></td>
  58. </tr>
  59. </tbody></table>
  60.  

Aproveitem… 100% Testado no MySQL

Agência OFF, desenvolvimento de soluções web para as Agências Digitais


2 Respostas para Script: Paginação 1 2 3 [4] 5 6 : Funciona também no MySQL

  1. Mano vc resolveu meu problema, VALEW MESMO.

  2. Cara, absolutepage nao funciona no MYSQL.

    Vlw

Deixe seu Comentário