Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

rubenssoto2005

com paginação

Recommended Posts

galera to com um problema na paginação ela parece que ta funcionando mas nao ta exibindo os resultados nao da erro nenhum

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>BaixeTudo | Downloads - Utilitários</title><style type="text/css"><!--body {	margin-top: 0px;	margin-left: 0px;}a:link {	text-decoration: none;	color: #0066FF;}a:visited {	text-decoration: none;	color: #0066FF;}a:hover {	text-decoration: none;}a:active {	text-decoration: none;}#Layer1 {	position:absolute;	left:18px;	top:244px;	width:148px;	height:174px;	z-index:1;}.style5 {	font-size: 12px;	font-weight: bold;	font-family: "Trebuchet MS";}--></style></head><body><table width="802" border="0" cellpadding="0" cellspacing="0">  <!--DWLayoutTable-->  <tr>	<td width="12" height="2"></td>	<td width="170"></td>	<td width="19"></td>	<td width="605"></td>	<td width="4"></td>  </tr>  <tr>	<td height="194" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">	  <!--DWLayoutTable-->	  <tr>		<td width="802" height="92"><img src="imagens/topo.gif" width="810" height="194" /></td>		</tr>	</table></td>  </tr>  <tr>	<td height="19"></td>	<td></td>	<td></td>	<td></td>	<td></td>  </tr>        <tr>	<td height="286"></td>	<td valign="top"><table width="105%" border="0" cellpadding="0" cellspacing="0" background="imagens/menu.gif" style="background-repeat:no-repeat;">	  <!--DWLayoutTable-->	  <tr>		<td width="5" height="24"> </td>		<td width="155"> </td>		<td width="10"> </td>	  </tr>	  <tr>		<td height="195"> </td>		<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">		  <!--DWLayoutTable-->		  <tr>			<td width="155" height="195" valign="top"><table width="155" border="0" cellspacing="2">				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="index.asp">Home</a></span></span></td>				  </tr>				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="utilitarios.asp">Utilitários</a> </span></td>				  </tr>				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="mp3.asp">MP3 e Música</a> </span></td>				  </tr>				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="video.asp">Video</a></span></td>				  </tr>				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="rede.asp">Rede e Internet</a> </span></td>				  </tr>				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="imagem.asp">Imagem</a> </span></td>				  </tr>				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="antivirus.asp">Antivirus e Segurança</a> </span></td>				  </tr>				</table></td>			  </tr>		</table></td>		<td> </td>	  </tr>	  <tr>		<td height="67"> </td>		<td> </td>		<td> </td>	  </tr>	  	  	  	  	  	  	  	  	  	</table></td>	<td> </td>	<td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="imagens/navegacao.gif" style="background-repeat:no-repeat;">	  <!--DWLayoutTable-->	  <tr>		<td width="596" height="30"> </td>		<td width="9"> </td>	  </tr>	  <tr>		<td height="174" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">		  <!--DWLayoutTable-->		  <tr>			<td width="596" height="143" valign="top"><table width="587" border="0" cellspacing="0">			  <tr>				<td colspan="2"><div align="center"><strong>Utilitários</strong></div></td>			  </tr>			  <tr>				<td colspan="2"><img src="imagens/Untitled-1.gif" width="150" height="110" /></td>			  </tr>			  <tr>				<td width="400" bgcolor="#CCCCCC"><strong>Nome</strong></td>				<td width="177" bgcolor="#CCCCCC"><strong>Autor</strong></td>			  </tr>			  <!-- #include file="conexao.asp" --><%PAGE_SIZE = 5If Request.QueryString("page") = "" Then	' Abertua inicial	iPageCurrent = 1Else	iPageCurrent = CInt(Request.QueryString("page"))End If%><%Set RS = Server.CreateObject("adodb.recordset")RS.PageSize  = PAGE_SIZERS.CacheSize = PAGE_SIZEsql = "select * from utilitarios ORDER BY id DESC"set rs = Server.CreateObject("ADODB.Recordset")RS.Open SQL,conexao,3,3 iRecordCount = RS.RecordCount   iPageCount   = RS.PageCount	If iRecordCount = 0 Then	   Response.Write "nenhum registro encontrado"   Response.End 'paramos o programa	Else				' caso contrário monta a paginação	RS.AbsolutePage = iPageCurrent		' determina qual página deve ser exibida%>			  			  <% While Not RS.EOF And RS.AbsolutePage = iPageCurrent  			 			   if backcolor = "#ffffff" then backcolor = "#f8f8ff" else backcolor = "#ffffff" end if			  %>			  <tr>				<td bgcolor="<%=backcolor%>"> <a href="utilitariosdetalhe.asp?id=<%=rs("id")%>"><%=rs("nome")%></a></td>				<td bgcolor="<%=backcolor%>"><div align="left"><%=rs("autor")%></div></td>			  </tr>			  			  			 <% 	RS.MoveNext		' próximo registro	Wend	%> 	<tr>				<td colspan="2">				</td>				</tr>			</table>			</td>		  </tr>		</table>		</td>		<td> </td>	  </tr>	  <tr>		<td height="126"> </td>		<td> </td>	  </tr>	  <tr>		<td height="23" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">		  <!--DWLayoutTable-->		  <tr>			<td width="596" height="23"><div align="center">			<%		' informa que página o usuário está da paginação		response.write "Páginas: "		For I = 1 To iPageCount			If I = iPageCurrent Then				response.write "[" & I & "]" 			Else				' criamos um link a categoria escolhida e a 				' página a ser mostrada				%><a href="<%= strURL %>?page=<%= I %>"><%= I %></a> <%			End If		Next	End If%></div></td>		  </tr>		</table>		<%RS.CloseSet RS = NothingSet Conexao = Nothing%>		</td>		<td> </td>	  </tr>	  <tr>		<td height="244"> </td>		<td> </td>	  </tr>	  	  	  	  	  	  	  	  	  	  	  	  	  	</table></td>	<td> </td>  </tr>  <tr>	<td height="264"></td>	<td> </td>	<td> </td>	<td> </td>  </tr>  <tr>	<td height="35"></td>	<td> </td>	<td> </td>	<td> </td>	<td> </td>  </tr></table></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

você colocar para deixar 5 registros por pagina foi isto??quandos registros tem no total??

Compartilhar este post


Link para o post
Compartilhar em outros sites

O problema esta nesse loopWhile Not RS.EOF And RS.AbsolutePage = iPageCurrent faz o seguintes testeWhile Not RS.EOFvai funcionar!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

obrigado consegui resolver o problema era no meu include

 

agora ta funcionando direitim da uma olhada

 

<%Set Conn = Server.CreateObject("AdoDb.Connection")Conn.provider="Microsoft.Jet.OLEDB.4.0"Conn.connectionstring=Server.Mappath("bd\baixetudo.mdb")Conn.openPAGE_SIZE = 20 ' Você pode alterar sem conforme precise%><%If Request.QueryString("page") = "" Then	' Abertua inicial	iPageCurrent = 1Else	iPageCurrent = CInt(Request.QueryString("page"))End If%><%Set RS = Server.CreateObject("adodb.recordset")RS.PageSize  = PAGE_SIZERS.CacheSize = PAGE_SIZEsql = "select * from utilitarios ORDER BY id DESC"RS.Open SQL,Conn,3,3 iRecordCount = RS.RecordCount   iPageCount   = RS.PageCount	If iRecordCount = 0 Then	   Response.Write "nenhum registro encontrado"   Response.End 'paramos o programa	Else				' caso contrário monta a paginação	RS.AbsolutePage = iPageCurrent		' determina qual página deve ser exibida%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>BaixeTudo | Downloads - Utilitários</title><style type="text/css"><!--body {	margin-top: 0px;	margin-left: 0px;}a:link {	text-decoration: none;	color: #0066FF;}a:visited {	text-decoration: none;	color: #0066FF;}a:hover {	text-decoration: none;}a:active {	text-decoration: none;}#Layer1 {	position:absolute;	left:18px;	top:244px;	width:148px;	height:174px;	z-index:1;}.style5 {	font-size: 12px;	font-weight: bold;	font-family: "Trebuchet MS";}--></style></head><body><table width="802" border="0" cellpadding="0" cellspacing="0">  <!--DWLayoutTable-->  <tr>	<td width="12" height="2"></td>	<td width="170"></td>	<td width="19"></td>	<td width="605"></td>	<td width="4"></td>  </tr>  <tr>	<td height="194" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">	  <!--DWLayoutTable-->	  <tr>		<td width="802" height="92"><img src="imagens/topo.gif" width="810" height="194" /></td>		</tr>	</table></td>  </tr>  <tr>	<td height="19"></td>	<td></td>	<td></td>	<td></td>	<td></td>  </tr>        <tr>	<td height="286"></td>	<td valign="top"><table width="105%" border="0" cellpadding="0" cellspacing="0" background="imagens/menu.gif" style="background-repeat:no-repeat;">	  <!--DWLayoutTable-->	  <tr>		<td width="5" height="24"> </td>		<td width="155"> </td>		<td width="10"> </td>	  </tr>	  <tr>		<td height="195"> </td>		<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">		  <!--DWLayoutTable-->		  <tr>			<td width="155" height="195" valign="top"><table width="155" border="0" cellspacing="2">				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="index.asp">Home</a></span></span></td>				  </tr>				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="utilitarios.asp">Utilitários</a> </span></td>				  </tr>				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="mp3.asp">MP3 e Música</a> </span></td>				  </tr>				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="video.asp">Video</a></span></td>				  </tr>				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="rede.asp">Rede e Internet</a> </span></td>				  </tr>				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="imagem.asp">Imagem</a> </span></td>				  </tr>				  <tr>					<td><span class="style5"><img src="imagens/seta.gif" width="11" height="11" /> <a href="antivirus.asp">Antivirus e Segurança</a> </span></td>				  </tr>				</table></td>			  </tr>		</table></td>		<td> </td>	  </tr>	  <tr>		<td height="67"> </td>		<td> </td>		<td> </td>	  </tr>	  	  	  	  	  	  	  	  	  	</table></td>	<td> </td>	<td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="imagens/navegacao.gif" style="background-repeat:no-repeat;">	  <!--DWLayoutTable-->	  <tr>		<td width="160" height="30"> </td>		<td width="295"> </td>		<td width="141"> </td>		<td width="9"> </td>	  </tr>	  <tr>		<td height="174" colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">		  <!--DWLayoutTable-->		  <tr>			<td width="596" height="143" align="center" valign="top"><table width="587" border="0" cellspacing="0">			  <tr>				<td colspan="2"><div align="center"><strong>Utilitários</strong></div></td>			  </tr>			  <tr>				<td colspan="2"><img src="imagens/Untitled-1.gif" width="150" height="110" /></td>			  </tr>			  <tr>				<td width="400" bgcolor="#CCCCCC"><strong>Nome</strong></td>				<td width="177" bgcolor="#CCCCCC"><strong>Autor</strong></td>			  </tr>				  			  <% While Not RS.EOF And RS.AbsolutePage = iPageCurrent  			 			   if backcolor = "#ffffff" then backcolor = "#f8f8ff" else backcolor = "#ffffff" end if			  %>			  <tr>				<td bgcolor="<%=backcolor%>"> <a href="utilitariosdetalhe.asp?id=<%=rs("id")%>"><%=rs("nome")%></a></td>				<td bgcolor="<%=backcolor%>"><div align="left"><%=rs("autor")%></div></td>			  </tr>			  			  			 <% 	RS.MoveNext		' próximo registro	Wend	%> 	<tr>				<td colspan="2">				</td>				</tr>						</table>			</td>		  </tr>		</table>		</td>		<td> </td>	  </tr>	  <tr>		<td height="82"> </td>		<td> </td>		<td> </td>		<td> </td>	  </tr>	  <tr>		<td height="32"> </td>		<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">		  <!--DWLayoutTable-->		  <tr>			<td width="295" height="32"><div align="center">			  <%		' informa que página o usuário está da paginação		response.write "Páginas: "		For I = 1 To iPageCount			If I = iPageCurrent Then				response.write "[" & I & "]" 			Else				' criamos um link a categoria escolhida e a 				' página a ser mostrada				%>				  <a href="<%= strURL %>?page=<%= I %>"><%= I %></a> 				  <%			End If		Next	End If%>			</div></td>			  </tr>		</table></td>		<td> </td>		<td> </td>	  </tr>	  <tr>		<td height="297"> </td>		<td> </td>		<td> </td>		<td> </td>	  </tr>	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	</table></td>	<td> </td>  </tr>  <tr>	<td height="264"></td>	<td> </td>	<td> </td>	<td> </td>  </tr>  <tr>	<td height="35"></td>	<td> </td>	<td> </td>	<td> </td>	<td> </td>  </tr></table></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.