<%
REM -----------------------------------
REM 作 者:王勤军
[email protected]REm 创作日期:2004-10-12
REM 修改日期:2005年1月24日 星期一
REM -----------------------------------
'函数 实用数据分页显示函数
'参数:DataSQL ----------- 当前页面数据的SQL语句
'参数:CountSQL ----------- 查询总条数的SQL语句
'参数:Page ----------- 哪 页
'参数:PageSize ----------- 页 次
'参数:THeadStrings ------- 显示表头列名称定义,用“,”分隔,与DataSQL里面的列名对应。
'实 例:=======================================
'
'
'<%
'dim iPageSize,CurPage
' iPageSize = 18
' CurPage = 1
'if (Request.Form <> "") then
' if IsEmpty(Request.Form("p")) then
' CurPage = 1
' elseif IsNumeric(Request.Form("p")) then
' CurPage = CLng(Request.Form("p"))
' end if
'end if
'ShowRecords "exec p_show accounts,"&iPageSize&","&CurPage&",'account_code,account_password,account_serial,account_type,account_money,stock_time'","select count(account_code) as total from [accounts]",CLng(CurPage),iPageSize,"卡号,密码,序列号,卡类型,卡金额,入库时间"
'CloseDB()
'% >
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub ShowRecords(DataSQL,CountSQL,Page,PageSize,ModelStrings,THeadStrings)
dim total,rs,DatMessages
dim UseDataModel
if (Request.Form("pagerTotal") <> "") then
total = CLng(Request.Form("PagerTotal"))
else
total = conn.execute(CountSQL)(0)
end if
if Len(ModelStrings)<8 then '模版长度在此定义为8
UseDataModel = false
else
UseDataModel = true
end if
DatMessages = DatMessages & "