This is a function on the page, placed in the page.inc, mainly for the data is not very large database, where the HTML format of the function can be changed.
' File name: Page.inc
' Function: function to process data paging
"Author: Heaven and earth are useless"
Sub Showpagebar (Totalpage,curpage,strurl)
' parameter totalpage: entire page
' Parameter curpage: current page
' parameter strURL: The connection address used for paging
DIM strpage
Curpage=getvalidpageno (Totalpage,curpage)
Response.Wr
js| Paging//author tar (bigangell@yesky.com)
You can copy the code in any copy, but please add the above author information
If you have any questions, please contact me.
Effect Please see http://210.77.144.64/kk/java/java/article.jsp
int i;int ipage=10;int allpage;int pages;int cpage=1;int spage;
Java.lang.String Sql,pagesql;Java.sql.ResultSet rs,pagers;
Pagesql = "SELECT count (a_id) as a from article";pagers = Sqlconn.executequery
)ElseUsername = "this user does not exist"End ifSet mycomm = nothing
6. Stored Procedures that return both parameters and Record SetsSometimes, we need a stored procedure to return both parameters and record sets. For example, when using Stored Procedure paging, we need to return parameters such as the record set and total data. The following is a stored procedure for paging:
/* SP6 */Create procedure DBO. getuserlist@ Ipagecount int output, -- total number of pages@
When displaying the records in a table, you need to display the records by page because there are many records. Here, the SQL Stored procedure is used to display the records by page.1. For database and field, see conn. asp.Add several records to the table2. Stored Procedure CodeCreate procedure dbo. getUserList@ IPageCount int OUTPUT, -- Total number of pages@ IPage int, -- current page number@ IPageSize int -- number of records per pageAsSet nocount
return parameters such as the record set and total data. The following is a stored procedure for paging:
/* SP6 */
Create procedure DBO. getuserlist
@ Ipagecount int output, -- total number of pages
@ Ipage int, -- current page number
@ Ipagesize int -- number of records per page
As
Set nocount on
Begin
-- Create a temporary table
Create Table # T (ID int identity, -- auto-increment Field
Userid int,
Username varchar (40 ))
-- Write data to the tempo
parameters and Record Sets
Sometimes, we need a stored procedure to return both parameters and record sets. For example, when using Stored Procedure paging, we need to return both the record set and total data parameters.Number. The following is a stored procedure for paging:
/* SP6 */Create procedure DBO. getuserlist@ Ipagecount int output, -- total number of pages@ Ipage int, -- current page number@ Ipagesize int -- number of records per pageAsS
, when using Stored Procedure paging, we need to return parameters such as the record set and total data. The following is a stored procedure for paging:
/* SP6 */Create procedure DBO. getuserlist@ Ipagecount int output, -- total number of pages@ Ipage int, -- current page number@ Ipagesize int -- number of records per pageAsSet nocount onBegin-- Create a temporary tableCreate Table # T (ID int identity, -- auto-increment FieldUserid int,Username varc
Returns the stored process for both parameters and recordsetsSometimes, we need the stored process to return both parameters and recordsets, such as returning the recordset and the total amount of data while using the storage process paging. The following is a stored process that handles paging:
/*sp6*/CREATE PROCEDURE DBO. Getuserlist@IPAGECOUNT INT OUTPUT,--Total pages@IPAGE INT,--current page number@IPAGESIZE INT--Number of records per pageAsSET N
int i;int ipage=5; Pagesint allpage; Page numbersint pages; The number of pages acceptedint cpage=1; When you are in front ofint spage; Start Pageint allcol=0;Vector V=null;Data Library Connection soundsConnection Conn=null;Java.lang.String Sql,pagesql;Java.sql.ResultSet rs,pagers;Statement Statement=null;String kmsdb= "Jdbc:microsoft:sqlserver://localhost:1433;databasename=db_szscz";Class.forName ("Com.microsoft.jdbc.sqlserver.SQLServerDriver");conn
JS int i;
int ipage=5; Pages
int allpage; Page numbers
int pages; The number of pages accepted
int cpage=1; When you are in front of
int spage; Start Page
int allcol=0;
Vector v=null;//Data Library connection sounds
Connection Conn=null;
Java.lang.String Sql,pagesql;
Java.sql.ResultSet rs,pagers;
Statement Statement=null;
String kmsdb= "Jdbc:microsoft:sqlserver://127.0.0.1:1433;databasename=dbname";
Class.forName ("Com.microsoft.jdbc.sqlserver.SQLServ
following two parameters is also reversed. . parameters. append. createparameter ("@ username", 40) . parameters. append. createparameter ("@ userid", 3,1, 4, userid) . execute end with If mycomm (0) = 1 then username = mycomm (1) else username = "this user does not have" end if set mycomm = nothing 6. stored processes that return both parameters and Record Sets sometimes, we need the stored process to return both parameters and record sets. For example, when using the stored process
and record sets. For example, when using Stored Procedure paging, we need to return parameters such as the record set and total data. The following is a stored procedure for paging:
/* SP6 */Create procedure dbo. getUserList@ IPageCount int OUTPUT, -- total number of pages@ IPage int, -- current page number@ IPageSize int -- number of records per pageAsSet nocount onBegin-- Create a temporary tableCreate table # t (ID int IDENTITY, -- auto-increment
UserName = "This user does not exist"
End If
Set Mycomm = Nothing
6. Return parameters and Recordset stored procedures at the same time
Sometimes, we need stored procedures to return both parameters and recordsets, such as when using a stored procedure paging, returning both the recordset and the total amount of data. The following is a stored procedure that handles paging:
/*sp6*/
CREATE PROCEDURE Dbo.getuserlist
@iPageCount int OUTPUT,--Total pages
@iPa
JS
int i;
int ipage=5; Pages
int allpage; Page numbers
int pages; The number of pages accepted
int cpage=1; When you are in front of
int spage; Start Page
int allcol=0;
Vector V=null;
Data Library Connection sounds
Connection Conn=null;
Java.lang.String Sql,pagesql;
Java.sql.ResultSet rs,pagers;
Statement Statement=null;
String kmsdb= "Jdbc:microsoft:sqlserver://127.0.0.1:1433;databasename=dbname";
Class.forName ("Com.microsoft.jdbc.sqlserver.SQLSer
return both parameters and recordsets, such as when using a stored procedure paging, returning both the recordset and the total amount of data. The following is a stored procedure that handles paging:
/*sp6*/CREATE PROCEDURE Dbo.getuserlist@iPageCount int OUTPUT,--Total pages@iPage int,--current page number@iPageSize INT--Number of records per pageAsSET NOCOUNT ONBegin--Create a temporary tableCREATE TABLE #t (ID int IDENTITY,--self-added fieldUserID
Mycomm = Nothing
6. Return parameters and Recordset stored procedures at the same time
Sometimes, we need stored procedures to return both parameters and recordsets, such as when using a stored procedure paging, returning both the recordset and the total amount of data. The following is a stored procedure that handles paging:
/*sp6*/
CREATE PROCEDURE Dbo.getuserlist
@iPageCount int OUTPUT,--Total pages
@iPage int,--current page number
@iPageSize INT-
Why don't you back up data? I have also considered this problem. Have you ever thought about such foreign vps or something? Back up all the websites and say that it would take hundreds of megabytes.
You cannot download it every day, right? This bandwidth is not enough. Even if the bandwidth is sufficient, you may have to download the vps one day.
OK ~ Let's get started with this free backup question. It's actually not free, but there is a premise that you have bought a domain name at godaddy.co
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.