murugesanks
Programmer
Mr. Harold Blackorby,
Actually i am trying to display 5 records in a page and giving link to other pages like,
25 Records found.
(1-5) (6-10) (11-15) (16-20) (21-25)
Page 1
---------------------
1.First Record.
2. Second record
3. Third Record
4. Fourth Record.
5. Fifth Record.
---------------------
When I click (6-10) link It should display Next 5 records,…..
For the above I tried like.
<%
DIM currentPage, rowCount, i
currentPage = TRIM( Request( "currentPage" ) )
if currentPage = "" then currentPage = 1
set DBConn = server.createobject("adodb.connection"
DBConn.open "dsn=portdsn;uid=sa;pwd=;database=PortDB"
Set MemDisRS = Server.CreateObject("ADODB.Recordset"
MemDisRS.CursorType = adOpenStatic
MemDisRS.PageSize = 5
MemDisRS.Open "select * from table1 order by no", DBConn
Response.write "Current Page Value is :"
Response.write currentPage
Response.Write "<br><br>"
MemDisRS.AbsolutePage = cINT( currentPage )
rowCount = 0
x1="hi"
While not MemDisRS.EOF and rowCount < MemDisRS.PageSize
Response.Write MemDisRS(0)
Response.Write "<br>"
rowCount = rowCount + 1
MemDisRS.MoveNext
Wend
Response.Write "<hr>"
for i = 1 to MemDisRS.PageCount
%><a href="TradersDisplayTest1.asp?currentPage=<%=i%>"><%=i%></a> <%
next
%>
It is giving the following Error.
--
ADODB.Recordset error '800a0cb3'
Object or provider is not capable of performing requested operation.
Tradersdiaplaytest1.asp line 18.
--
Line no 18 is:
MemDisRS.AbsolutePage = cINT( currentPage )
I think MemDisRS.AbsolutePage is giving error. Because I tried to display the Recordscount. But it is returning -1(minus one). But in Database 25 recirds are there.
Actually i am trying to display 5 records in a page and giving link to other pages like,
25 Records found.
(1-5) (6-10) (11-15) (16-20) (21-25)
Page 1
---------------------
1.First Record.
2. Second record
3. Third Record
4. Fourth Record.
5. Fifth Record.
---------------------
When I click (6-10) link It should display Next 5 records,…..
For the above I tried like.
<%
DIM currentPage, rowCount, i
currentPage = TRIM( Request( "currentPage" ) )
if currentPage = "" then currentPage = 1
set DBConn = server.createobject("adodb.connection"
DBConn.open "dsn=portdsn;uid=sa;pwd=;database=PortDB"
Set MemDisRS = Server.CreateObject("ADODB.Recordset"
MemDisRS.CursorType = adOpenStatic
MemDisRS.PageSize = 5
MemDisRS.Open "select * from table1 order by no", DBConn
Response.write "Current Page Value is :"
Response.write currentPage
Response.Write "<br><br>"
MemDisRS.AbsolutePage = cINT( currentPage )
rowCount = 0
x1="hi"
While not MemDisRS.EOF and rowCount < MemDisRS.PageSize
Response.Write MemDisRS(0)
Response.Write "<br>"
rowCount = rowCount + 1
MemDisRS.MoveNext
Wend
Response.Write "<hr>"
for i = 1 to MemDisRS.PageCount
%><a href="TradersDisplayTest1.asp?currentPage=<%=i%>"><%=i%></a> <%
next
%>
It is giving the following Error.
--
ADODB.Recordset error '800a0cb3'
Object or provider is not capable of performing requested operation.
Tradersdiaplaytest1.asp line 18.
--
Line no 18 is:
MemDisRS.AbsolutePage = cINT( currentPage )
I think MemDisRS.AbsolutePage is giving error. Because I tried to display the Recordscount. But it is returning -1(minus one). But in Database 25 recirds are there.