Link to home
Start Free TrialLog in
Avatar of MeenakshiDhar
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.Connection")
    cnn.Open "Provider=MSDAORA.1;Password=aaa;User 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
ASKER CERTIFIED SOLUTION
Avatar of hongjun
hongjun
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MeenakshiDhar
MeenakshiDhar

ASKER

Thanks a lot hongjun.....