i'm trying to put a paging record that i found on the net in my page, i think everything is ok, but i get an error that i've never seen before, here's my code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
'Variáveis
Dim conn
Dim strCon
Dim ass
Dim id
Dim sql
Dim PgSz
Dim CurrPg
Dim PgCt
%>
<%
if Request.QueryString("Id"
= "" or Request.QueryString("Id"
= null then
id = 1
else
id = Request.QueryString("Id"
end if
%>
<%
PgSz = 2 'number of records per page
If Request("Page"
= "" Then
CurrPg = 1
Else
CurrPg = CInt(Request("Page"
)
End If
%>
<%
Set conn = Server.CreateObject("ADODB.connection"
strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("opiniao.mdb"
conn.open strcon
sql = "SELECT * FROM Assuntos WHERE Idsubcat = "&Id&" and status=1"
set ass = conn.execute(sql)
ass.PageSize = PgSz
PgCt = ass.PageCount
%>
<html>
<head>
<title>Votação</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<!--#include file="search.inc"-->
<p>
<% If ass.eof Then %>
Não Existem Votações nesta Sub-Categoria </p>
<% Else %>
<%= Request.QueryString("mess"
%>
<%
If 1 > CurrPg Then CurrPg = 1
If CurrPg > PgCt Then CurrPg = PgCt
ass.AbsolutePage = CurrPg <-- Line 56
%>
<table width="75%" border="0">
<%
Do While ass.AbsolutePage = CurrPg And Not ass.EOF
%>
<tr>
<td> </td>
<td><%= ass("Assunto"
%></td>
<td><a href="results.asp?id=<%= ass("idAssunto"
%>">Ver Resultados</a></td>
</tr>
<tr>
<td colspan="2">
<form name="poll" method="post" action="update.asp?id=<%= ass("IdAssunto"
%>">
<label>
<input type="radio" name="hip" value="1">
</label>
<%= ass("Perg1"
%><br>
<label>
<input type="radio" name="hip" value="2">
</label>
<%= ass("Perg2"
%><br>
<label>
<input type="radio" name="hip" value="3">
<%= ass("Perg3"
%><br>
<input type="submit" name="Submit" value="votar">
</label>
</form>
</td>
</tr>
<% ass.movenext %>
<%
loop
%>
</table>
<% End If %>
<%
'Navigation System
If CurrPg <> 1 Then %>
<a href='polls.asp?id=" &id& " and page=" &CurrPg -1'>
Previous</a>
<%
End If
%>
<%
If CurrPg < PgCt Then %>
<a href='polls.asp?id=" &id& and page=" &CurrPg +1'>
Next</a>
<%
End If
'End Navigation System
%>
</body>
</html>
<%
ass.Close()
Set ass = Nothing
%>
This is the error
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/opinião/polls.asp, line 56
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
'Variáveis
Dim conn
Dim strCon
Dim ass
Dim id
Dim sql
Dim PgSz
Dim CurrPg
Dim PgCt
%>
<%
if Request.QueryString("Id"
id = 1
else
id = Request.QueryString("Id"
end if
%>
<%
PgSz = 2 'number of records per page
If Request("Page"
CurrPg = 1
Else
CurrPg = CInt(Request("Page"
End If
%>
<%
Set conn = Server.CreateObject("ADODB.connection"
strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("opiniao.mdb"
conn.open strcon
sql = "SELECT * FROM Assuntos WHERE Idsubcat = "&Id&" and status=1"
set ass = conn.execute(sql)
ass.PageSize = PgSz
PgCt = ass.PageCount
%>
<html>
<head>
<title>Votação</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<!--#include file="search.inc"-->
<p>
<% If ass.eof Then %>
Não Existem Votações nesta Sub-Categoria </p>
<% Else %>
<%= Request.QueryString("mess"
<%
If 1 > CurrPg Then CurrPg = 1
If CurrPg > PgCt Then CurrPg = PgCt
ass.AbsolutePage = CurrPg <-- Line 56
%>
<table width="75%" border="0">
<%
Do While ass.AbsolutePage = CurrPg And Not ass.EOF
%>
<tr>
<td> </td>
<td><%= ass("Assunto"
<td><a href="results.asp?id=<%= ass("idAssunto"
</tr>
<tr>
<td colspan="2">
<form name="poll" method="post" action="update.asp?id=<%= ass("IdAssunto"
<label>
<input type="radio" name="hip" value="1">
</label>
<%= ass("Perg1"
<label>
<input type="radio" name="hip" value="2">
</label>
<%= ass("Perg2"
<label>
<input type="radio" name="hip" value="3">
<%= ass("Perg3"
<input type="submit" name="Submit" value="votar">
</label>
</form>
</td>
</tr>
<% ass.movenext %>
<%
loop
%>
</table>
<% End If %>
<%
'Navigation System
If CurrPg <> 1 Then %>
<a href='polls.asp?id=" &id& " and page=" &CurrPg -1'>
Previous</a>
<%
End If
%>
<%
If CurrPg < PgCt Then %>
<a href='polls.asp?id=" &id& and page=" &CurrPg +1'>
Next</a>
<%
End If
'End Navigation System
%>
</body>
</html>
<%
ass.Close()
Set ass = Nothing
%>
This is the error
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/opinião/polls.asp, line 56