<% '' This program file name: Pages.asp%>
<% '' Contains ADO constant table file Adovbs.inc, can copy% from "/ Program Files / Common Files / System / ADO" directory>
<% '' * Established database connections, here is Oracle8.05 database
Set conn = server.createObject ("adoDb.connection")
Conn.open "provoder = msdaora.1; data source = yoursrcname; user ID = YourUserid; password = Yourpassword;"
SET RS = Server.createObject ("AdoDb.Recordset") '' Create a Recordset object
rs.cursorLocation = aduseclient '' Settings Recording Set Guinder Properties
'' * Set the total number of records in one page, can be adjusted as needed
rs.pagesize = 10
'' * Set the query statement
Strsql = "SELECT ID, Name, Address, Phone" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
Rs.Open Strsql, Conn, AdopenStatic, AdlockReadonly, AdcmdText
%>
// Click "[First]" response:
Function PageFirst ()
{
Document.myform.currentpage.selectedIndex = 0;
Document.myform.currentpage.onchange ();
}
// Click "[Previous]" response:
Function PagePrior ()
{
Document.myform.currentpage.selectedindex -;
Document.myform.currentpage.onchange ();
}
// Click "[Next]" response:
Function PageNext ()
{
Document.myform.currentpage.selectedIndex ;
Document.myform.currentpage.onchange ();
}
// Click "[Last page]" response:
Function Pagelast ()
{
Document.myform.currentPage.SelectedIndex = document.myform.currentpage.length-1;
Document.myform.currentpage.onchange ();
}
// Response when selecting "page":
Function PageCurrent ()
{//Pages.asp is the file name of this program
Document.myform.Action = 'Pages.asp? Page =' (Document.myform.currentPage.SelectedIndex 1) Document.myform.Submit ();
}
Script>
HEAD>
<% IF r.eof then
Response.write (" [There is no record in the database!] Font>")
Else
'' Specify current page number
IF Request ("currentpage" = "" "" ""
rs.absolutePage = 1
Else
Rs.absolutePage = ClNG (Request ("CurrentPage"))
END IF
'' Creating a form myform, method is get
Response.write ("