1Asp中使用存储过程代码收集CREATE procedure p_splitpage
 2Asp中使用存储过程代码收集@sql nvarchar(4000),
 3Asp中使用存储过程代码收集@page int=1,
 4Asp中使用存储过程代码收集@pagesize int,
 5Asp中使用存储过程代码收集@pageCount int=0 output,
 6Asp中使用存储过程代码收集@recordCount int=0 output
 7Asp中使用存储过程代码收集as
 8Asp中使用存储过程代码收集set nocount on
 9Asp中使用存储过程代码收集declare @p1 int
10Asp中使用存储过程代码收集
11Asp中使用存储过程代码收集exec sp_cursoropen @p1 output,@sql,@scrollopt=1,@ccopt=1,@rowcount=@pagecount output
12Asp中使用存储过程代码收集set @recordCount=@pageCount
13Asp中使用存储过程代码收集select @pagecount=ceiling(1.0*@pagecount/@pagesize)
14Asp中使用存储过程代码收集,@page=(@page-1)*@pagesize+1
15Asp中使用存储过程代码收集exec sp_cursorfetch @p1,16,@page,@pagesize
16Asp中使用存储过程代码收集exec sp_cursorclose @p1
17Asp中使用存储过程代码收集GO
18Asp中使用存储过程代码收集
19Asp中使用存储过程代码收集
20Asp中使用存储过程代码收集'通过存储过程调用数据库的数据
21Asp中使用存储过程代码收集'sql为查询语句,m_pagesize为页面显示行,rst为记录集,totalpages为分多少页,num为多少条记录,curpage为当前页数
22Asp中使用存储过程代码收集Sub SelectDB(sql,m_pageSize,rst,totalpages,num,curpage)
23Asp中使用存储过程代码收集if curpage = "" then
24Asp中使用存储过程代码收集curpage = Trim(Request.Form("pageno"))
25Asp中使用存储过程代码收集if curpage = "" then
26Asp中使用存储过程代码收集curpage = Trim(Request.QueryString("pageno"))
27Asp中使用存储过程代码收集end if
28Asp中使用存储过程代码收集if curpage = "" then
29Asp中使用存储过程代码收集curpage = 1
30Asp中使用存储过程代码收集end if
31Asp中使用存储过程代码收集end if
32Asp中使用存储过程代码收集
33Asp中使用存储过程代码收集Set cmd = Server.CreateObject("ADODB.Command")
34Asp中使用存储过程代码收集cmd.ActiveConnection = conn
35Asp中使用存储过程代码收集cmd.CommandType = adCmdStoredProc
36Asp中使用存储过程代码收集cmd.CommandText = "p_SplitPage"
37Asp中使用存储过程代码收集
38Asp中使用存储过程代码收集cmd.Parameters.Append cmd.CreateParameter("@sql", adVarWChar, adParamInput, 4000, sql)
39Asp中使用存储过程代码收集cmd.Parameters.Append cmd.CreateParameter("@page", adInteger, adParamInput, 4, curpage)
40Asp中使用存储过程代码收集cmd.Parameters.Append cmd.CreateParameter("@pageSize", adInteger, adParamInput, 4, m_pageSize)
41Asp中使用存储过程代码收集cmd.Parameters.Append cmd.CreateParameter("@pageCount", adInteger, adParamOutput, 4, totalpages)
42Asp中使用存储过程代码收集cmd.Parameters.Append cmd.CreateParameter("@recordCount", adInteger, adParamOutput, 4, num)
43Asp中使用存储过程代码收集
44Asp中使用存储过程代码收集'Response.Write sql&"<br/>"
45Asp中使用存储过程代码收集set rst = cmd.Execute
46Asp中使用存储过程代码收集set rst  = rst.NextRecordSet
47Asp中使用存储过程代码收集
48Asp中使用存储过程代码收集totalpages = cmd.Parameters("@pageCount").value
49Asp中使用存储过程代码收集num = cmd.Parameters("@recordCount").value
50Asp中使用存储过程代码收集
51Asp中使用存储过程代码收集if totalpages = 0 then totalpages = 1
52Asp中使用存储过程代码收集End Sub
53Asp中使用存储过程代码收集

相关文章: