CREATE PROC myx_prPageRecordset
@queryStr nvarchar(
@keyField nvarchar (
@pageSize int
@pageNumber int
AS
BEGIN
DECLARE @sqlText AS nvarchar(
DECLARE @sqlTable AS nvarchar(
SET @sqlTable =
SET @sqlText =
CAST(@pageNumber * @pageSize AS varchar(
EXEC (@sqlText)
END
GO
核心代碼
Dim strsql As String
myComm = New SqlClient
myComm
myComm
myComm
myComm
myComm
myComm
myComm
myComm
myComm
呵呵
建立一個test(id
向test添充幾十條數據
@queryStr= * from test
@keyField=[ID]
@pageSize=
@pageNumber=
問題出來了
id name fid
根據傳入參數
id name fid
下面是我參照小春的存儲分頁寫的分頁存儲過程
CREATE Procedure prGetRecordByPage
(
@PageSize int
@PageNumber int
@QuerySql varchar(
@KeyField varchar(
)
AS
Begin
Declare @SqlTable AS varchar(
Declare @SqlText AS Varchar(
Set @SqlTable=
Set @SqlText=
+
+
+
Exec(@SqlText)
End
GO
From:http://tw.wingwit.com/Article/program/Oracle/201311/17708.html