P
Paolo Galli
hi everybody
I'm trying to get this code working but I'm having problems...
I'm using Access and a query on it
What I want is paging the recordset I get
I can get the rs filled but I don't know how to page it... the only
example I have works but only using a rs.AbsolutePage method that
doesn't work with my code...
here is the snippet
'getting data
connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("test.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connStr
Set rs = Server.CreateObject("ADODB.Recordset")
Set rs = conn.Execute ("exec q_anagrafica")
rs.PageSize = number
rs.AbsolutePage = pag
While NOT rs.EOF And counter < number
response.write ( rs("id") & " - " & rs("nome") )
response.write ( "<hr>" )
rs.Movenext
counter = counter + 1
WEnd
the error I'm getting is the following
Current Recordset does not support bookmarks. This may be a limitation
of the provider or of the selected cursortype
if instead of the previous rc conn.execute I use the following
rs.open ("SELECT * from t_anagrafica"), conn, 3
the pagination works correctly.
How can I correct the code in order to have it working with my query?
thanks a lot
Paolo
I'm trying to get this code working but I'm having problems...
I'm using Access and a query on it
What I want is paging the recordset I get
I can get the rs filled but I don't know how to page it... the only
example I have works but only using a rs.AbsolutePage method that
doesn't work with my code...
here is the snippet
'getting data
connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("test.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connStr
Set rs = Server.CreateObject("ADODB.Recordset")
Set rs = conn.Execute ("exec q_anagrafica")
rs.PageSize = number
rs.AbsolutePage = pag
While NOT rs.EOF And counter < number
response.write ( rs("id") & " - " & rs("nome") )
response.write ( "<hr>" )
rs.Movenext
counter = counter + 1
WEnd
the error I'm getting is the following
Current Recordset does not support bookmarks. This may be a limitation
of the provider or of the selected cursortype
if instead of the previous rc conn.execute I use the following
rs.open ("SELECT * from t_anagrafica"), conn, 3
the pagination works correctly.
How can I correct the code in order to have it working with my query?
thanks a lot
Paolo