Ir para conteúdo

POWERED BY:

Arquivado

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

Marcondes

Paginação ASP/SQL

Recommended Posts

PRECISO COLOCAR PAGINAÇÃO NESTA PÁGINA. ALGUÉM PODE ME AJUDAR???

 

 

<!-- #include file="..\..\includes\functions.asp" --><!-- #include file="..\..\includes\connection.asp" --><%	Response.AddHeader "cache-control", "private"	Response.AddHeader "Pragma","No-Cache"	Response.Buffer = TRUE	Response.Expires = 0	Response.ExpiresAbsolute = 0%><%Dim ActionDim Var01Dim Var02Dim Var03Dim Var04Dim Var05Dim Var06Dim strSQLDim ObjRsAction	= Request("Action")If Action = "" Then Request.QueryString("Action") End IfSelect Case (Action) 	Case 1	Action	=	1			Field01	= "Anúncios" 			Field02	= "NameClass"				Case 2	Action	=	3			Field01	= "Categorias"			Field02	= "NameCateg"End SelectVar01	=	0Var02	=	0Var03	=	0Var04 	=	0Var05	=	0	Var06	=	0Set oRsSQL	= Server.CreateObject("ADODB.RecordSet")	strSQL		= "exec sp_sel_EV_Class '" & Action & "'"oRsSQL.Open strSQL,conn,3,3Set ObjRs 	= 	conn.Execute(strSQL)%><html><link rel="stylesheet" href="../styles/style.css" type="text/css"><head><script>function check_exclui(){		if(window.confirm('Tem certeza que deseja EXCLUIR ?')){				form.action="fu_exc_class.asp?action=2"				form.submit();		}		else		window.location = "alt_con_exc_class.asp?action=2"	}</script><title></title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><div align="center" style="width: 756; height: 119">  <table width="75%" border="0" cellspacing="0" cellpadding="0" height="1" align="center"><tr>	  <td width="736" valign="top" height="136"> <table border="0" cellpadding="0" cellspacing="0" width="81%" align="center"><tr bgcolor="ffffff"> 			<td colspan="3" bgcolor="#ffffff"> <div align="center" class="texto_normalbold">			  <div align="left" class="texto_normalbold">				<p><img src="../images/classificados.gif" width="197" height="31"></p>				</div>			</div>			<div align="center"></div></td>		  </tr>		  <tr>		  <td height="24" colspan="3" align="center" class="fundoCelula2" ><span class="texto_normalboldred"><%=Request("msg")%></span> </td>		  </tr>		  <tr>		  			<td colspan="3"><form name="form" method="GET" onSubmit="return checkdata_alt_regiao();">				<table width="736" border="0" cellspacing="0" cellpadding="0" height="1">				  <tr> 					<td height="1" align="center" width="734"> 					  <table width="90%" border="0" align="left" cellpadding="1" cellspacing="1" >												<tr><td></td>						</tr>						<tr> 						  <td class="fundo_titulo_superior" width="147" height="21" align="center" > 							<div align="left" class="fundo_titulo_superior"><font size="1"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="1"><%If Action = 1 Then %>Anunciante<%Else %>Categoria<%End If%></font> 						  </font> </font></div></td>						  <td class="fundo_titulo_superior" width="165" align="center" ><div align="left" class="fundo_titulo_superior"><font size="1"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="1"><%If Action = 1 Then %>Descrição<%Else %>Tipo<%End If%></font> </font> </font></div></td>						  <%If Action = 1 Then%><td class="fundo_titulo_superior" width="120" align="center" ><div align="left" class="fundo_titulo_superior"><font size="1"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="1">Tipo</font> </font> </font></div></td>						  <td class="fundo_titulo_superior" width="137" align="center" ><div align="left" class="fundo_titulo_superior"><font size="1"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="1">Categoria</font> </font> </font></div></td><%End If%>						  <td class="fundo_titulo_superior" width="10%" height="21" align="center" > </td></tr>						<%If objRS.EOF Then%>						<tr>						<td colspan="5" align="center" class="texto_form">						<%							Response.write "Não há dados a serem exibidos..."						%>						</td>						</tr>						<%End If%>						<%vIntCounter = 0%>																		<%While Not objRS.EOF %>						<tr> 						  <td class="fundoCelula" width="147" height="24" align="center" > 							<div align="left" class="fundoCelula"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000"> 							  <%Response.write objRS(Field02)%>						  </font> </b></font></div></td>						  <td class="fundoCelula" width="165" align="center" ><div align="left" class="fundoCelula"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">							<%								  If Action = 1 Then									  Response.write Mid((objRS(4)),1,20)									  Response.write "..."								Else									Response.write objRS(4)								End If							%>						  </font> </b></font></div></td>							<%If Action = 1 Then%><td class="fundoCelula" width="120" align="center" ><div align="left" class="fundoCelula"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">							  <%Response.write objRS(8)%>						  </font> </b></font></div></td>						  <td class="fundoCelula" width="137" align="center" ><div align="left" class="fundoCelula"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">							  <%Response.write objRS(10)%>						  </font> </b></font></div></td>						  <%End If%>						  <td width="10%" height="24" align="center" valign="bottom" class="fundoCelula" > 							<div align="center"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000"> 							  							  							  							  <input type="checkbox" name="radio" id="<%=vIntCounter%>" value="<%=ObjRs(0)%>"  > 						  </font> </b></font></div></td>						</tr>						  <%  vIntCounter = vIntCounter + 1  objRS.MoveNext  Wend  %>  <tr> 						  <td height="21" colspan="5" align="center" class="fundo_titulo_superior" ><label>							<input name="Submit" type="button" onClick="checkthis(this)" class="box" value="Alterar">														<input name="Submit2" type="button" onclick="java script:checkdata_escolhe_consulta()" class="box" value="Consultar">							<input name="Submit3" type="button" onclick="java script:check_exclui()" class="box" value="Excluir">							</label></td>						  <%If Action = 1 Then%>						  <%End If%>						  </tr>    <%    Set objRs = Nothing  Set conn = Nothing  %>					  </table>					</td>				  </tr>				</table>			  </form>			</td>		  </tr>		</table>	  </td>	</tr>  </table></div></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Dê uma olhada em nosso "Laboratório de Scripts", lá tem exemplos de paginação.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não consegui fazer funcionar com nenhum exemplo, talvez seja porque estou usando procedure e não select na página...alguém pode me ajudar???

Compartilhar este post


Link para o post
Compartilhar em outros sites

realmente, com procedure naum sei naum... nunca fiz... algumas pessoas tb passaram perguntando isto e ninguem achou uma resposta, pelo menos naum falaram hehehehe...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não vejo motivos para não funcionar com PROCEDURES, visto que ele retorna dados para o RecordSet e o que é paginado é o RS.

Compartilhar este post


Link para o post
Compartilhar em outros sites

você jah tentou ?se conseguiu posta um exemplo ae pra mim por favor... pq eu realmente naum consegui....flw

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não entendi umas coisas, você seta um oRsSQL como um RECORDSET ADO (que pode ser paginado), abre ele e não usa, depois seta um ObjRs (implicito, que não pode ser paginado) e usa ele para exibir os dados. Dessa forma a paginação não rolaria.

você jah tentou ?

se conseguiu posta um exemplo ae pra mim por favor... pq eu realmente naum consegui....

 

flw

Nunca tentei, não trabalho integralmente com ASP e em meus projetos não uso Procedures (ainda).

Compartilhar este post


Link para o post
Compartilhar em outros sites

Mudei o código para :Set ObjRs = Server.CreateObject("ADODB.RecordSet") strSQL = "exec sp_sel_EV_Class '" & Action & "'"Set ObjRs = conn.Execute(strSQL,3)e tentei colocar a paginação e também não funcionou....alguém aí sabe o que fazer??? tô ficando louco com esta porcaria...

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.