<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Response.Buffer = true Response.CacheControl = "no-cache" Response.redirect("default.asp") %>
Agenda

<% dim conn 'db connection dim rs 'recordset dim sql 'sql query Dim iPageSize 'How big our pages are Dim iPageCount 'The number of pages we get back Dim iPageCurrent 'The page we want to show dim iRecordsShown dim i 'counter dim idioma idioma=request("idioma") if idioma = "" then idioma = "BR" end if iPageSize = 10 'you can edit how many messages per page if request("page")="" then iPageCurrent = 1 else iPageCurrent = cint(request.querystring("page")) end if Set conn = Server.CreateObject("ADODB.Connection") Set rs = Server.CreateObject("ADODB.Recordset") conn.Open dsn'open connection sql = "select * from agenda where idioma = '"& idioma &"' order by codigo desc" rs.Open sql, conn,adOpenStatic, adLockReadOnly, adCmdText rs.PageSize = iPageSize rs.CacheSize = iPageSize iPageCount = rs.PageCount iRecordsShown = 0 if rs.eof AND Rs.bof =True Then response.write "• Nenhum evento cadastrado!" else RS.AbsolutePage = iPageCurrent Do While iRecordsShown < iPageSize And Not Rs.EOF %>
<%=rs("titulo")%>
<%=rs("conteudo")%>
 

<% iRecordsShown = iRecordsShown+1 rs.movenext loop %>
<% if ipagecount > "1" then for i=1 to ipagecount response.write "" & i & " " next end if %>
Página <%= iPageCurrent %> de <%= iPageCount %> <% end if rs.close set rs= nothing conn.close set conn = nothing %>