Zou Jian's paging storage process--changed it
Because Zou Jian’s paging stored procedure cannot return the total number of records, he has to count it again every time he paging, so he added a return number of records to it, which is easy to use.
@iPageCountintOUTPUT--Define the output variable and place it on @QueryStr
....
exec('select'+@FdShow+'from'+@QueryStr+@FdOrder)--Stat the number of records, put it--if the first page is displayed...
Select@iPageCount=@@rowcount
Calling method (ASP):
MyConStr="Driver={SQLServer};server=(local);Uid=artme;Pwd=***;Database=artme"
DIMMyComm,UserID,UserName
SetMyComm=Server.CreateObject("ADODB.Command")
withMyComm
.ActiveConnection=MyConStr'MyConStr is the database connection string
.CommandText="p_show"' specifies the stored procedure name
.CommandType=4' indicates that this is a stored procedure
.Prepared=true' requires SQL commands to be compiled first
.Parameters.Append.CreateParameter("RETURN",2,4)
.Parameters.Append.CreateParameter("@iPageCount",3,2)
.Parameters.append.CreateParameter("@QueryStr",200,1,4000,"select*fromzw_language")
.Parameters.append.CreateParameter("@PageSize",3,1,4,5)
.Parameters.append.CreateParameter("@PageCurrent",3,1,4,1)
.Parameters.append.CreateParameter("@FdShow",200,1,4000)
.Parameters.append.CreateParameter("@FdOrder",200,1,1000)
.Execute
endwith
iCount=MyComm(1)
Response.writeiCount
Trackback:http://tb.blog.csdn.net/TrackBack.aspx?PostId=566682