MeenakshiDhar
asked on
Paging in ASP using Oracle
Hi All,
I want to include Paging in my Website. I m using ASP with Oracle...since oracle does not support (rs.AbsolutePage)
so wht's the otherway to do it...
The code is given below--
========================== ========== ========== =====
<%
dim thisPage, rowcount, i
thisPage = Trim(Request("thisPage"))
if thisPage = "" then thisPage = 1
set cnn = server.CreateObject("ADODB .Connectio n")
cnn.Open "Provider=MSDAORA.1;Passwo rd=aaa;Use r ID=aaa;Data Source=INDV;Persist Security Info=True"
set rst = Server.CreateObject("ADODB .Recordset ")
with rst
.CursorType = adOpenStatic
.PageSize = 10
.Open "SELECT * FROM document_types ", cnn
.AbsolutePage = cINT(thisPage)
end with
rowCount = 0
while not rst.EOF and rowCount < rst.PageSize
Response.Write "<a href='" & rst("DT_ID") & "'>" & rst("Document_Type") & "</a><br>"
rowCount = rowCount + 1
rst.MoveNext
wend
Response.Write "<br clear=all>Next Page >"
for i = 1 to rst.PageCount
%>
<a href="Test.asp?thisPage=<% =i%>"><%=i %></a>
<% next %>
========================== ========== ========== ========== ====
Regards,
Meenakshi Dhar
I want to include Paging in my Website. I m using ASP with Oracle...since oracle does not support (rs.AbsolutePage)
so wht's the otherway to do it...
The code is given below--
==========================
<%
dim thisPage, rowcount, i
thisPage = Trim(Request("thisPage"))
if thisPage = "" then thisPage = 1
set cnn = server.CreateObject("ADODB
cnn.Open "Provider=MSDAORA.1;Passwo
set rst = Server.CreateObject("ADODB
with rst
.CursorType = adOpenStatic
.PageSize = 10
.Open "SELECT * FROM document_types ", cnn
.AbsolutePage = cINT(thisPage)
end with
rowCount = 0
while not rst.EOF and rowCount < rst.PageSize
Response.Write "<a href='" & rst("DT_ID") & "'>" & rst("Document_Type") & "</a><br>"
rowCount = rowCount + 1
rst.MoveNext
wend
Response.Write "<br clear=all>Next Page >"
for i = 1 to rst.PageCount
%>
<a href="Test.asp?thisPage=<%
<% next %>
==========================
Regards,
Meenakshi Dhar
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER