WEB开发网
开发学院WEB开发ASP MS-SQL 分页函数+ASP 阅读

MS-SQL 分页函数+ASP

 2009-06-04 12:06:45 来源:WEB开发网   
核心提示: dim maxCount dim myobj dim rsCount maxCount = 0 Set myobj = Server.CreateObject("ADODB.Command") with myobj .ActiveConnection = conn .C

dim maxCount

dim myobj

dim rsCount

maxCount = 0

Set myobj = Server.CreateObject("ADODB.Command")

with myobj

.ActiveConnection = conn

.CommandText = "USP_GetTotal"

.CommandType = 4

.Prepared = true

.Parameters.append .CreateParameter("@strTableName", 200, 1, 30, strTableName)

.Parameters.append .CreateParameter("@strWhere", 200, 1, 2000, strWhere)

Set rsCount = .Execute

end with

Set myobj = Nothing

maxCount = rsCount("Total")

rsCount.close:Set rsCount = Nothing

getDataRowCount = maxCount

end function

'单表分页存储过程

sub getDataRS()

dim obj

Set obj = Server.CreateObject("ADODB.Command")

with obj

.ActiveConnection = conn

.CommandText = "USP_GetList"

.CommandType = 4

.Prepared = true

.Parameters.append .CreateParameter("@pageIndex", 3, 1, 4, iPageIndex)

.Parameters.append .CreateParameter("@pageSize", 3, 1, 4, iPageSize)

.Parameters.append .CreateParameter("@SID", 200, 1, 30, SID) ' 2000

.Parameters.append .CreateParameter("@strGetField", 200, 1, 1000, strGetField)

.Parameters.append .CreateParameter("@tableName", 200, 1, 30, strTableName)

上一页  1 2 3 4  下一页

Tags:MS SQL 函数

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接