Ir para conteúdo

Arquivado

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

marciolvs

Paginação

Recommended Posts

Bom dia pessoal....

 

Tentei solucionar um caso mais até o momento nada deu certo..

 

Veja o link http://www.voguecosmeticos.com.br/lista.as...g=8&sctg=13

 

O erro é, sempre que eu clico na ultima pagina da paginação ele exibe o erro que mostra no link acima..

 

o codigo completo é:

 

<html><head><title>\\ Vogue Cosméticos \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="css.css" rel="stylesheet" type="text/css"></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table width="779" border="0" align="center" cellpadding="0" cellspacing="0" class="txtgeral">  <tr valign="top"> 	<td width="180" bgcolor="#dfdfdf"><!-- #include file="menuprodutos.asp"--></td>	<td width="428"><table width="426" border="0" align="center" cellpadding="0" cellspacing="0" class="txtgeral">		<tr> 		  <td bgcolor="#c6c6c6" height="5"><img src="pix_transp.gif" width="1" height="1"></td>		</tr>		<tr> 		  <td>		  <!-- inicio da listagem -->		  		  <script language="JavaScript" type="text/javascript"><!--			var winhandle = null;						function popUp(aURL, aWidth, aHeight) {			  if ((winhandle != null) && (! winhandle.closed)){							winhandle.resizeTo(aWidth, aHeight);				winhandle.location.replace(aURL);						  }			  else			  {				winhandle=window.open(aURL, "imagewin", 'width=' + eval(aWidth) + ',height=' + eval(aHeight) + ',resizable, location=0, scrollbars=1, statusbar=0, toolbar=0');			  }						  winhandle.focus();						}						//-->			</script>			<!-- #include file="inc/conexao.asp"-->			<%			'dim conexaodb			codsubdepto = request("sctg")			coddepto = request("ctg")						SQL = "SELECT count(id) As id FROM Produtos Where categoria="&coddepto&" and subcategoria="&codsubdepto			Call abreconexao			Set RScount = conexaodb.execute(SQL)			totalProdutos= Rscount("id")									Sql = "Select * From produtossubcategorias Where id="&codsubdepto			Call Abreconexao			Set rssubdepto = conexaodb.execute(Sql)			subdepartamento = Rssubdepto("nome")									%>			<link href="inc/estilos.css" rel="stylesheet" type="text/css">												<table align=center width="426" class="txtgeral">					<tr>						<td align="left" style="border:#212121;	border-style:dashed; border-right-width:0px; border-top-width:0px; border-bottom-width:1px; border-left-width:0px;">   Encontrado(s) <font color="red" face="Arial, Helvetica, sans-serif"><b>					  <%response.Write(totalprodutos)%></b></font> Produto(s) em <b><%=subdepartamento%></b>.</td>					</tr>			</table>					<%'if totalproduto = 0 then%>					<!--<tr>						<td align="center"><br>No momento não encontra-se nenhum PRODUTO cadastrado com este dapartamento.<br>Escolha outro departamento por favor...<br></td>					</tr>-->					<%'end IF%>			<script language="JavaScript" type="text/javascript"><!--						var winhandle = null;						function popUp(aURL, aWidth, aHeight) {			  if ((winhandle != null) && (! winhandle.closed)){							winhandle.resizeTo(aWidth, aHeight);				winhandle.location.replace(aURL);						  }			  else			  {				winhandle=window.open(aURL, "imagewin", 'width=' + eval(aWidth) + ',height=' + eval(aHeight) + ',resizable,  location=0, scrollbars=0, statusbar=0, toolbar=0');			  }						  winhandle.focus();						}						//--></script>			<table align=center width="426" class="txtgeral">					<%if totalProdutos = 0 then%>					<tr>						<td align="center"><br>No momento não encontra-se nenhum <b>Produto</b> cadastrado com este dapartamento.<br>Escolha outro departamento por favor...<br></td>					</tr>					<%end IF%>			</table>			<table align="center" width="426" class="txtgeral">							<TR>						<%						'Lista Fotos Pequenas						 SQL = "SELECT * FROM produtos where categoria="&coddepto&" and subcategoria="&codsubdepto						 if trim(request("ultSequencial"))<>"" then							SQL = SQL & " AND numSequencial>" & request("ultSequencial")						end if												Set conexaodb = Server.CreateObject("ADODB.Connection")						conexaodb.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("banco/database.mdb") & ";Persist Security Info=False"						 set rcd = server.createObject("ADODB.RECORDSET")						'qtd de fotos na primeira pagina						 Rcd.PageSize = 10						 SQL = SQL & " order by Id desc" 												 rcd.open SQL, conexaodb, 3												 vtotal=rcd.recordcount							if not rcd.eof then 								If Request("pagina")="" then								 intpagina=1								Else								 If Cint(Request("pagina"))<1 then								  intpagina=1								 Else								  If Cint(Request("pagina"))>Rcd.PageCount then								   intpagina=Rcd.PageCount								  Else								   intpagina=Request("pagina")								  End If								 End if								End if								i=2								vcounter=1								Rcd.AbsolutePage=intpagina								intrec=0																Do while not rcd.eof 								'Do while intrec<Rcd.PageSize and not rcd.eof 									if i=2 then 										response.write "</TR><TR>"										i=0									end if									'response.write "<td> </td><TD align='center'><a href=""java script:popUp('detalhes.asp?codigo=" & Rcd("Id") & "', 550 , 330)"" class=""link""><img src=""images_foto/" & rcd("fotop") & """ width=""100"" border=0><br>" & left(Rcd("descricao"),65)& "... Veja mais</a><br></td>"												'						if rcd("valor") <> "" then			'							valor = rcd("valor")			'						else			'							valor = response.Write("A Consultar")			'						end if																		response.write "<td> </td><TD align='center'><a href=""detalhes.asp?ctg=" & Rcd("categoria") & "&sctg=" & Rcd("subcategoria") & "&codigo=" & Rcd("Id") & """ class=""txtvejamais""><img src=""images_foto/" & rcd("fotop") & """ border=0><br><b>"&rcd("nome")&"</b><br>"&LEFT (rcd("Descricao"),70)&"<b> ... Veja mais</b></a>"%></td><%																		vult=rcd("Id")									rcd.movenext									vcounter = vcounter+1									i=i+1									if vcounter>10 then 										exit do									end if									ntrec=intrec+1								Loop								response.write "</TR>"							end if							'rcd.close							dim num 							num=0							%>			</table>						<center>							<%				'Paginação'				'If intpagina>1 then %>				  <!--<a href="lista.asp?pagina=<%'=intpagina-1%>&ctg=<%'=Rcd("categoria")%>&sctg=<%'=Rcd("subcategoria")%>">Anterior</a> -->				  <%'end if										For i=1 to Rcd.PageCount					If i = Cint(intpagina) then%>				  [<%=i%>] 				  <% else %>				  <a href="lista.asp?pagina=<%=i%>&ctg=<%=Rcd("categoria")%>&sctg=<%=Rcd("subcategoria")%>">[<%=i%>]</a>				  <%end if					Next										'If strcomp(intpagina,Rcd.PageCount)<>0 then %>				  <!--<a href="lista.asp.asp?pagina=<%'=intpagina+1%>&ctg=<%'=Rcd("categoria")%>&sctg=<%'=Rcd("subcategoria")%>">Próxima</a> -->				 <%'end if%>										</center>			<%rcd.close			set rcd = nothing%>					  <!-- Fim da listagem -->			</td>		</tr>	  </table>	</td>	<td width="171" background="images/menu_background.jpg"><!-- #include file="menu.asp"-->	</td>  </tr>  <tr valign="top"> 	<td colspan="3"><!-- #include file="rodape.asp"-->	</td>  </tr></table></body></html>
Se alguém poder me ajudar agradeço..

 

 

Muito obrigado!

 

Sem mais

Marcio Leandro

Desenvolvedor WEB.

marciolvs@yahoo.com.br

Compartilhar este post


Link para o post
Compartilhar em outros sites

no final do código faça isso aki:

 

ASP
<%'end if
                   
                    For i=1 to Rcd.PageCount
                                        dim vi
                                       
                    If i = Cint(intpagina) then
                                                If i = "" Then
                                                        vi = "0"
                                                Else
                                                        vi = i
                                                End If
                                        %>
                  [<%=vi%>]
                  <% else %>
                  <a href="lista.asp?pagina=<%=vi%>&ctg=<%=Rcd("categoria")%>&sctg=<%=Rcd("subcategoria")%>">[<%=vi%>]</a>
                  <%end if
                    Next

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.