VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Demonstrates recordset paging.

by N. Pandu Ranga Rao. (3 Submissions)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Wed 10th October 2001
Date Added: Mon 8th February 2021
Rating: (2 Votes)

Demonstrates recordset paging.

Rate Demonstrates recordset paging.



<!--#include Virtual = "asp/adovbs.inc"-->
<head>
<title>Untitled</title>
</head>

<body>

<% if IsEmpty(Request.QueryString("PageNo")) = False then
    Dim PageNumber
Set Con = Server.CreateObject("Adodb.Connection")
Set Rs1 = Server.CreateObject("Adodb.Recordset")
Con.Open "Data Source=DSN;", "uid", "pwd"
Rs1.CursorLocation = adUseClient
Rs1.Open "Select * from Tname", Con, adOpenDynamic, adLockBatchOptimistic, adCmdText 
Rs1.Sort = "RoomNo"
Rs1.PageSize = 20
PageNumber = CInt(Request.QueryString("PageNo"))
if PageNumber < 1 or PageNumber > Rs1.PageCount-1 then
Response.Write("<strong>There is no such page number exisists.....</strong>")
Response.End
End if
Rs1.AbsolutePage = PageNumber
%>
<table width="90%" align="center">
<tr>
<td>Room No</td>
</tr>
<% for i = 0 to 20
if not Rs1.eof then%>
<tr>
<td><%=Rs1(0)%></td>
<% 
Rs1.MoveNext
end if
next
%>
</tr>
</table>
<% end if %>

</body>
</html>


Download this snippet    Add to My Saved Code

Demonstrates recordset paging. Comments

No comments have been posted about Demonstrates recordset paging.. Why not be the first to post a comment about Demonstrates recordset paging..

Post your comment

Subject:
Message:
0/1000 characters