資料顯示函數(asp)

來源:互聯網
上載者:User
<%
REM -----------------------------------
REM 作 者:王勤軍 qinjunit@yahoo.com
REm 創作日期:2004-10-12
REM 修改日期:2005年1月24日 星期一
REM -----------------------------------
'函數 實用資料分頁顯示函數
'參數:DataSQL ----------- 當前頁面資料的SQL語句
'參數:CountSQL ----------- 查詢總條數的SQL語句
'參數:Page ----------- 哪 頁
'參數:PageSize ----------- 頁 次
'參數:THeadStrings ------- 顯示表頭列名稱定義,用“,”分隔,與DataSQL裡面的列名對應。
'實 例:=======================================
'<!--#include virtual="inc/conn.asp"-->
'<!--#include virtual="inc/RW_DataPager.asp"-->
'<%
'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 & "<table width=""100%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"" style=""Border-Collapse:collapse;word-break:break-all"">"

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.