Ir para conteúdo

POWERED BY:

Arquivado

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

Caike

Paginação do iMasters

Recommended Posts

Estou utilizando a paginação que foi publicada em uma matéria aqui do iMasters

 

Paginação Imasters

 

Durante a execução, me vem o seguinte erro:

 

Object or provider is not capable of performing requested operation

 

referente a linha de código que contem

 

rsLogin.AbsolutePage = intpagina
Alguém aí sabe oq pode ser ? :wacko:

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tenho um codigo de pagiãção aqui muito bom , não sei se te serve, com ele você pode faser as buscas por tabela

 

<%Dim orderByorderBy = ("ASC")SQL_OrderBy = " ORDER BY DATA DESC"dim SQLdim SearchFordim SearchWhereSearchWhere = request("SearchWhere")SearchFor = request("SearchFor")dim SQL_SearchFordim SQL_SearchWhereIf (SearchWhere = "All") Then	SQL_SearchWhere = "(codigo LIKE ('%" & SearchFor & "%'))"Else	SQL_SearchWhere = SearchWhere & " LIKE ('%" & SearchFor & "%')"End IfIf NOT (SearchFor = "") Then	SQL_SearchFor = " WHERE " & SQL_SearchWhereElse	SQL_SearchFor = ""End IfSQL = "SELECT * FROM log" & SQL_SearchFor & SQL_OrderBy%><%Set RS = Server.CreateObject("ADODB.Recordset")colorchanger = 0color1 = RSCONF("COR1")color2 = RSCONF("COR1")dim intPagedim intPageCountdim intRecordCountIf Request.QueryString("page") = "" Then	intPage = 1	Else	intPage = Request.QueryString("page")End If	RS.CursorLocation = 3RS.CursorType = 3RS.ActiveConnection = Conn	RS.Open SQL, Conn, 1, 3	RS.PageSize = 15RS.CacheSize = RS.PageSizeintPageCount = RS.PageCountintRecordCount = RS.RecordCountIf NOT (RS.BOF AND RS.EOF) Then%> </p>              <div align="center">               <center><table border="1" cellpadding="3" cellspacing="0" width="640" bordercolor="#CCCCCC" style="border-collapse: collapse"><tr><td bgcolor="#EAEAEA" align="center" width="80" ><font face="Verdana" size="2">Código</font></td><td bgcolor="#EAEAEA" align="center" width="334"><font face="Verdana" size="2">Motivo</font></td><td bgcolor="#EAEAEA" align="center" width="185"><font face="Verdana, arial" size="1" color="#000000"><b> </b></font><font face="Verdana" size="2" color="#000000">Data e hora</font><font face="Verdana, arial" size="1" color="#000000"><b> </b></font></td></tr><%	If CInt(intPage) > CInt(intPageCount) Then intPage = intPageCount	If CInt(intPage) <= 0 Then intPage = 1  If intRecordCount > 0 Then 	 RS.AbsolutePage = intPage 	 intStart = RS.AbsolutePosition 	 If CInt(intPage) = CInt(intPageCount) Then    intFinish = intRecordCount 	 Else    intFinish = intStart + (RS.PageSize - 1) 	 End if  End If	If intRecordCount > 0 Then  For intRecord = 1 to RS.PageSize%><tr><td bgcolor="<%=color1%>" width="80">                                                                 </a><b><font size="1" face="Verdana"><%=RS("COD")%></font></b></td><td bgcolor="<%=color2%>" width="334">  <font size="1" face="Verdana"><%=RS("MOTIVO")%> </font></td><td bgcolor="<%=color1%>" width="185"><p align="center"><font face="Verdana" size="2"><%=RS("DATA")%> as <%=RS("HORA")%></a></font></td></tr><%RS.MoveNextIf colorchanger = 1 Then	colorchanger = 0	color1 = RSCONF("COR1")	color2 = RSCONF("COR1")Else	colorchanger = 1	color1 = RSCONF("COR2")	color2 = RSCONF("COR2")End IfIf RS.EOF Then Exit for	Next%> 	 <tr><td colspan="3" width="632"><div align="center">  <center>  <table border="0" cellpadding="0" width="100%" style="border-collapse: collapse" bordercolor="#111111"><tr><td width="50%" align="left"><font face="Verdana, arial" size="1"><%If cInt(intPage) > 1 Then%>	<a href="?orderby=<%=orderBy%>&page=<%=intPage - 1%>&SearchFor=<%=SearchFor%>&SearchWhere=<%=SearchWhere%>"><<<b>Pagina anterior</b></a><%End If%></font></td><td width="50%" align="right"><font face="Verdana, arial" size="1" ><%If cInt(intPage) < cInt(intPageCount) Then%>	<a href="?orderby=<%=orderBy%>&page=<%=intPage + 1%>&SearchFor=<%=SearchFor%>&SearchWhere=<%=SearchWhere%>"><b>Próxima pagina</b> >></a><%End If%></font></td></tr></table></center></div></td></tr></table></center>              </div>              <br><%End IfElseIf (SearchFor = "") Then%><center><font face="Verdana, arial" size="1"><p>Desculpe ! </p><p>sua busca não encontrou nenhum resultado.</p><p> </p></font></center><%Else%><center><font face="Verdana, arial" size="1">Desculpe ! </font><p><font face="Verdana, arial" size="1">sua busca não encontrou nenhum resultado.</font></p><p> </p>              </center><%End IfEnd IfRS.closeSet RS = Nothing%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

E tambem tem esta bem mais simples

 

 

ASP [/tr][tr]

<%

 

 

 

dim Conn

dim RS

Const intPageSize=15 'Tamanho da página - você pode alterar se quiser

dim intCurrPage

dim a

set Conn=Server.CreateObject("adodb.connection")

set rs=server.CreateObject("adodb.recordset")

 

Conn.CursorLocation=3 'AdUseClient

 

 

'Conexão com o BD

 

Conn.Open "provider=microsoft.jet.oledb.4.0;data source=" & server.MapPath("cadastros.mdb")

RS.Open "select * from sites",conn

 

if RS.EOF then

%>

<p align="center">

<font size="2" face="Verdana">Ainda não existe nenhuma imóvel cadastrado na cidade de <b></B></font>

<%

else

%>

 

</p>

 

<table border="0" width="907">

<tr>

<td width="229" bgcolor="#00C6FD" align="center">

<font face="Verdana" size="2">Cidade</font></td>

<td width="292" bgcolor="#00C6FD" align="center">

<font face="Verdana" size="2">Endereço</font></td>

<td width="238" bgcolor="#00C6FD" align="center">

<font face="Verdana" size="2">Modificar</font></td>

<td width="130" bgcolor="#00C6FD" align="center">

 </td>

</tr>

<%

 

 

intCurrPage=cint(Request.QueryString("CurrPage"))

 

 

if intCurrPage=0 then intCurrPage=1

 

RS.PageSize=intPageSize

 

RS.AbsolutePage=intCurrPage

 

 

 

a=0

while a < intPageSize and not RS.EOF

a=a+1

%>

<tr>

<td width="229" bgcolor="#D5F5FF"><font face="Verdana" size="2"><%=RS.Fields("Titulo")%></font></td>

<td width="292" bgcolor="#D5F5FF"><font face="Verdana" size="2"><%=RS.Fields("Titulo")%></font></td>

<td width="238" bgcolor="#D5F5FF">

<p align="center"><font face="Verdana" size="2">

<a href="?link=modificar_imovel&ID=<%=RS.Fields("Titulo")%>">Modificar</a></font></td>

<td width="130" bgcolor="#D5F5FF">

 </td>

</tr>

 

 

<%

RS.MoveNext

wend

 

 

%>

<tr>

<td colspan="4">

 

<p align="center"><font size="2" face="Verdana">Pagina</font><b><font size="2" face="Verdana">

<%

cid = Request.Querystring("cidade")

 

for a = 1 to RS.PageCount

if a <> intCurrPage then

 

Response.Write "<a href=""?cidade="&cid&"&Currpage=" & a & """>" & a & "</a> "

else

Response.Write a & " "

end if

next

Response.Write ""

if intCurrPage > 1 then

 

'Response.Write "<a href=""?cidade="&cid&"&Currpage=" & intCurrPage-1 & """>Página Anterior</a>"

end if

Response.Write " "

if intCurrPage < RS.PageCount then

 

'Response.Write "<a href=""?cidade="&cid&"&Currpage=" & intCurrPage+1 & """>Próxima Página</a>"

end if

RS.Close

Conn.Close

set rs=nothing

set conn=nothing

end if

 

%>

[/tr]

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.