[Resolvido] Erro 800a0cc1 em paginação
Salve galera, tenho uma página que exibe todos os dados do bd, até ai a página funcionava normal, mas percebi que como o banco seria muito grande ficaria muito ruim exibi-los em uma página só, foi ai que eu comecei a fuçar com paginação e então meus problemas começaram. Ao carregar a página ele exibe somente os 10 primeiros itens do bd, até ai Ok, então eu aperto em "próximo" para mostrar o restante dos ítens e então aparece a seguinte mensagem:
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.
/teste/sistema/exibe.asp, line 321
Ai em baixo está o código da página...(está uma bagunça, eu sei, fiz várias alterações na pressa e ficou desse jeito, pretendo arrumar assim que resolver a paginação =P)
Espero que alguém possa me ajudar, ja fucei em tdo no código, ja verifiquei cada virgula e nda... http://forum.imasters.com.br/public/style_emoticons/default/ermm.gif
Bom, é isso ai...
Desde já agradeço!!! :D
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="verifica.asp"-->
<!--#include file="topo.asp"-->
<!--#include file="procurar.asp"-->
<html>
<head>
<style type="text/css">
<!--
.style6 {color: #333333}
a:link {
color: #333333;
text-decoration: none;
}
a:visited {
color: #333333;
text-decoration: none;
}
a:hover {
color: #FF0000;
text-decoration: none;
}
a:active {
color: #FF0000;
text-decoration: none;
}
a {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
}
.style13 {font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #666666; font-weight: bold; }
.style28 {font-size: 10px; color: #FFFFFF; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; }
.style32 {
color: #990000;
font-size: 12px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style33 {color: #FF0000}
.style34 {color: #0000CC}
.style35 {
font-size: 9px;
color: #990000;
}
-->
</style>
<title>Visualisar Entrada</title>
</head>
<body>
<p><a href="menu.asp" class="style13">[Voltar Para o Menú]</a></p>
<p>
<%
Dim Sql
Set BdWeb = Server.CreateObject("ADODB.Connection")
BdWeb.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db/banco.mdb")
Sql = "SELECT * FROM Cadastro"
If not request.form("de")="" and not request.form("ate")="" then
Sql = Sql & " WHERE autonum between " & Request.Form("de") & " and " & Request.Form("ate") & ""
end if
If not request.form("fabricacao")="" then
Sql = Sql & " WHERE fabricacao Like '%" & Request.Form("fabricacao") & "%' "
end if
If not request.form("empresa")="" then
Sql = Sql & " WHERE empresa Like '%" & Request.Form("empresa") & "%' "
end if
If not request.form("patrimonio")="" then
Sql = Sql & " WHERE patrimonio Like '%" & Request.Form("patrimonio") & "%' "
end if
If not request.form("nota")="" then
Sql = Sql & " WHERE nota Like '%" & Request.Form("nota") & "%' "
end if
If not request.form("instrumento")="" then
Sql = Sql & " WHERE instrumento Like '%" & Request.Form("instrumento") & "%' "
end if
If Request.Form("mes") = 01 Then
Sql = Sql & " WHERE mes Like '%" & Request.Form("mes") & "%' and ano LIKE '%" & Request.Form("ano") & "%'"
End If
If Request.Form("mes") = 02 Then
Sql = Sql & " WHERE mes Like '%" & Request.Form("mes") & "%' and ano LIKE '%" & Request.Form("ano") & "%'"
End If
If Request.Form("mes") = 03 Then
Sql = Sql & " WHERE mes Like '%" & Request.Form("mes") & "%' and ano LIKE '%" & Request.Form("ano") & "%'"
End If
If Request.Form("mes") = 04 Then
Sql = Sql & " WHERE mes Like '%" & Request.Form("mes") & "%' and ano LIKE '%" & Request.Form("ano") & "%'"
End If
If Request.Form("mes") = 05 Then
Sql = Sql & " WHERE mes Like '%" & Request.Form("mes") & "%' and ano LIKE '%" & Request.Form("ano") & "%'"
End If
If Request.Form("mes") = 06 Then
Sql = Sql & " WHERE mes Like '%" & Request.Form("mes") & "%' and ano LIKE '%" & Request.Form("ano") & "%'"
End If
If Request.Form("mes") = 07 Then
Sql = Sql & " WHERE mes Like '%" & Request.Form("mes") & "%' and ano LIKE '%" & Request.Form("ano") & "%'"
End If
If Request.Form("mes") = 08 Then
Sql = Sql & " WHERE mes Like '%" & Request.Form("mes") & "%' and ano LIKE '%" & Request.Form("ano") & "%'"
End If
If Request.Form("mes") = 09 Then
Sql = Sql & " WHERE mes Like '%" & Request.Form("mes") & "%' and ano LIKE '%" & Request.Form("ano") & "%'"
End If
If Request.Form("mes") = 10 Then
Sql = Sql & " WHERE mes Like '%" & Request.Form("mes") & "%' and ano LIKE '%" & Request.Form("ano") & "%'"
End If
If Request.Form("mes") = 11 Then
Sql = Sql & " WHERE mes Like '%" & Request.Form("mes") & "%' and ano LIKE '%" & Request.Form("ano") & "%'"
End If
If Request.Form("mes") = 12 Then
Sql = Sql & " WHERE mes Like '%" & Request.Form("mes") & "%' and ano LIKE '%" & Request.Form("ano") & "%'"
End If
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open Sql, BdWeb, 3, 3
objRS.PageSize = 10
%>
<%
If objRS.BOF and objRS.EOF Then%>
<b><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">
<% response.write ("Não foram encontrados registros") %>
</b></p>
<%Else%>
<%
if Request.QueryString("pagina")="" then
intpagina = 1
else
if cint(Request.QueryString("pagina"))<1 then
intpagina = 1
else
if cint(Request.QueryString("pagina"))>objRS.PageCount then
intpagina = objRS.PageCount
else
intpagina = objRS("pagina")
end if
end if
end if
end if
%>
<table width="1079" border="0" align="center">
<tr>
<tr>
<td width="73" height="65">
<form name="form2" method="get" action="altera.asp">
<table width="1193" height="63" border="0" align="left" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#FF6600">
<td width="100" height="2" align="center" bgcolor="#CC0000"><div align="center"><span class="style28">Ref</span></div></td>
<td width="71" height="2" align="center" bgcolor="#CC0000"><div align="center" class="style28">
<div align="center">Data</div>
</div></td>
<td width="50" align="center" bgcolor="#CC0000"><div align="center" class="style28">
<div align="center">Empresa</div>
</div></td>
<td width="50" height="2" align="center" bgcolor="#CC0000"><p align="center" class="style28">Nota </td>
<td width="101" align="center" bgcolor="#CC0000"><div align="center" class="style28">
<div align="center">Instrumento</div>
</div></td>
<td width="54" align="center" bgcolor="#CC0000"><div align="center"><span class="style28">Marca</span></div></td>
<td width="95" align="center" bgcolor="#CC0000"><div align="center"><span class="style28"> Capacidade </span></div></td>
<td width="62" align="center" bgcolor="#CC0000"><div align="center" class="style28">Modelo</div></td>
<td width="92" align="center" bgcolor="#CC0000"><div align="center" class="style28">Nº Fabricação </div></td>
<td width="89" align="center" bgcolor="#CC0000"><div align="center"><span class="style28">Patrimônio</span></div></td>
<td width="81" align="center" bgcolor="#CC0000"><div align="center"><span class="style28">Acessório</span></div></td>
<td width="71" align="center" bgcolor="#CC0000"><div align="center" class="style28">Valor Unitário </div></td>
<td width="67" align="center" bgcolor="#CC0000"><div align="center" class="style28">Contato</div></td>
<td width="75" align="center" bgcolor="#CC0000"><div align="center" class="style28">Obs.</div></td>
<td width="89" align="center" bgcolor="#CC0000"><label><span class="style28"><font size="1"><b><font size="1"><b><font size="1"><b><font size="1"><b><font size="1"><b><font size="1"><b><font size="1"><b><font size="1"><b><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">
<input name="Submit" type="submit" class="style13" value="Alterar">
</font></b></font></b></font></b></font></b></font></b></font></b></font></b></font></b></font></b></font></span></label></td>
</tr>
<%
'Iniciamos o Loop
objRS.AbsolutePage = intpagina
intrec = 0
While intrec<objRS.PageSize and not objRS.eof
%>
<tr bgcolor="#FFFFE6">
<td width="100" height="2" align="center" bgcolor="#EAEAEA"><div align="left" class="style13">
<div align="center" class="style34"><span class="style33">
<%Response.write objRS("autonum")%>
</span></div>
</div></td>
<td width="71" height="2" align="center" bgcolor="#EAEAEA"><div align="left" class="style13">
<div align="center">
<%Response.write objRS("ddata")%>
</div>
</div></td>
<td width="50" align="center" bgcolor="#EAEAEA"><div align="left" class="style13">
<div align="center">
<%Response.write objRS("empresa")%>
</div>
</div></td>
<td width="50" height="2" align="center" bgcolor="#EAEAEA" class="style6"><div align="left" class="style13">
<div align="center">
<%Response.write objRS("nota")%>
</div>
</div></td>
<td width="101" align="center" bordercolor="#FF0000" bgcolor="#EAEAEA"><div align="left" class="style13">
<div align="center">
<%Response.write objRS("instrumento")%>
</div>
</div></td>
<td width="54" align="center" bgcolor="#EAEAEA"><div align="center" class="style13">
<%Response.write objRS("marca")%>
</div></td>
<td width="95" align="center" bgcolor="#EAEAEA"><div align="center" class="style13">
<%Response.write objRS("capacidade")%>
</div></td>
<td width="62" align="center" bgcolor="#EAEAEA"><div align="center" class="style13">
<%Response.write objRS("modelo")%>
</div></td>
<td width="92" align="center" bgcolor="#EAEAEA"><div align="center"><span class="style13">
<%Response.write objRS("fabricacao")%>
</span></div></td>
<td width="89" align="center" bgcolor="#EAEAEA"><div align="center"><span class="style13">
<%Response.write objRS("patrimonio")%>
</span></div></td>
<td width="81" align="center" bgcolor="#EAEAEA"><div align="center"><span class="style13">
<%Response.write objRS("acessorio")%>
</span></div></td>
<td width="71" align="center" bgcolor="#EAEAEA"><div align="center"><span class="style13">
<%Response.write objRS("vunitario")%>
<input type="hidden" name="autonum" value="<%=objRS("autonum")%>">
</span></div></td>
<td width="67" align="center" bgcolor="#EAEAEA"><div align="center"><span class="style13">
<%Response.write objRS("contato")%>
</span></div></td>
<td width="75" align="center" valign="middle" bgcolor="#EAEAEA"><div align="center"><span class="style13">
<%Response.write objRS("obs")%>
</span></div></td>
<td width="89" align="center" valign="baseline" bgcolor="#EAEAEA"><div align="center"><font size="1"><b><font size="1"><b><font size="1"><b><font size="1"><b><font size="1"><b><font size="1"><b><font size="1"><b><font size="1"><b><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">
<input type="radio" name="radio" value="<%=objRS(0)%>">
</font></b></font></b></font></b></font></b></font></b></font></b></font></b></font></b></font></b></font></div>
<label></label></td>
</tr>
<% objRS.MoveNext
intrec = intrec + 1
if objRS.eof then
response.write " "
end if
Wend
%>
</table>
</form>
<p>
</p>
<p>
<%
'Criamos as Validações para a navegação "Anterior" e "Próximo"
if intpagina>1 then
%>
<a href="exibe.asp?pagina=<%=intpagina-1%>">Anterior</a>
<%
end if
if StrComp(intpagina,objRS.PageCount)<>0 then
%>
<a href="exibe.asp?pagina=<%=intpagina + 1%>">Próximo</a>
<%
end if
objRS.close
BdWeb.Close
Set objRS = Nothing
%>
</p>
<% sql2 = Sql %>
<form name="form1" method="post" action="excel.asp" target="_blank">
<input type="hidden" name="excel" value="<%=sql2%>">
<input name="Submit2" type="submit" class="style13" value="Gerar Planilha" method="post">
</form>
<p>
</body>
</html>Discussão (18)
Carregando comentários...