欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

易心asp分頁類 v1.0

 更新時(shí)間:2007年11月08日 21:38:02   作者:  
易心asp分頁類v1.0
復(fù)制代碼 代碼如下:

<% 
class Ex_SplitPageCls 
'========================================================================== 
'易心asp分頁類v1.0 
'作者:易心 QQ:343931221 
'個(gè)人網(wǎng)站 www.ex123.net www.bo56.com  
'演示地址:www.ex123.net/show/page 
'轉(zhuǎn)載請保留此信息 
'========================================================================== 
dim Ex_Rs 
dim Ex_columns'要提取的字段 
dim Ex_datafrom'數(shù)據(jù)表名 
dim Ex_strWhere'記錄篩選條件 
dim Ex_order'sql排序 
dim Ex_idcount'記錄總數(shù) 
dim Ex_pageSize'每頁條數(shù) 
dim Ex_pageCount'總頁數(shù) 
dim Ex_ids'獲得本頁要用到的id 
dim Ex_Sql'構(gòu)造的sql語句 
dim Ex_page'當(dāng)前顯示頁碼 
dim Ex_Conn'數(shù)據(jù)庫聯(lián)接對象 
dim Ex_index'數(shù)據(jù)庫記錄當(dāng)前位置 
dim Ex_id'主鍵字段 
private sub class_initialize 
set Ex_Rs=server.CreateObject("adodb.recordset") 
Ex_id="id" 
Ex_pageSize=20 
end sub 
private sub class_terminate 
Ex_rs.close 
set Ex_rs=nothing 
end sub 
'屬性賦值: 
public property let letConn(str) 
        Ex_conn=str 
end property 
'屬性賦值:sql語句 要查詢的字段 帶select 
public property let letColumns(str) 
        Ex_Columns=str 
end property 
'屬性賦值:sql語句篩選條件部分 帶where 
public property let letWhere(str) 
        Ex_strWhere=str 
end property 
'屬性賦值:sql語句數(shù)據(jù)表 帶from 
public property let letDataFrom(str) 
        Ex_dataFrom=str 
end property 
'屬性賦值:sql語句排序部分 帶order by 
public property let letOrder(str) 
        Ex_order=str 
end property 
'屬性賦值:每頁記錄數(shù) 
public property let letPageSize(str) 
        Ex_pageSize=str 
end property 
'屬性賦值:當(dāng)前頁數(shù) 
public property let letPage(str) 
        Ex_page=str 
end property 
'屬性賦值:主表主鍵字段 
public property let letId(str) 
        Ex_Id=str 
end property 
'屬性:獲得記錄總數(shù) 
public property get getRsCount 
        getRsCount=Ex_idCount 
end property 
'屬性:獲得頁總數(shù) 
public property get getPageCount 
if(Ex_idcount>0) then'如果記錄總數(shù)=0,則不處理 
        if(Ex_idcount mod Ex_pageSize=0)then'如果記錄總數(shù)除以每頁條數(shù)有余數(shù),則=記錄總數(shù)/每頁條數(shù)+1 
                  Ex_pageCount=int(Ex_idcount/Ex_pageSize)'獲取總頁數(shù) 
        else 
                  Ex_pagecount=int(Ex_idcount/Ex_pageSize)+1'獲取總頁數(shù) 
        end if 
        getPageCount=Ex_pagecount 
else 
        getPageCount=0 
end if 
end property 
'屬性:獲得當(dāng)前頁數(shù) 
public property get getPage 
        getPage=Ex_Page 
end property 
'獲得本頁要用到的id 
private sub ids 
        dim i 
        Ex_sql="select "&Ex_Id&" "& Ex_datafrom &" " &" "&Ex_strWhere&" "&Ex_order 
        Ex_rs.open Ex_sql,Ex_conn,1,1 
        if not Ex_Rs.eof and not Ex_Rs.bof then 
                Ex_rs.pagesize =Ex_pageSize '每頁顯示記錄數(shù) 
                Ex_Rs.absolutepage=CInt(Ex_Page) 
                Ex_idcount=Ex_rs.recordcount 
            if Ex_page < 1 then Ex_page = 1 
            if Ex_page > Ex_pagecount then Ex_page = Ex_pageCount 
            if Ex_pageCount > 0 then Ex_rs.absolutepage =Ex_page   
                for i=1 to Ex_rs.pagesize 
                if Ex_rs.eof then exit for   
                          if(i=1)then 
                           Ex_Ids=Ex_rs("id") 
                  else 
                           Ex_Ids=Ex_Ids &","&Ex_rs("id") 
                  end if 
                Ex_rs.movenext 
                next 
        end if 
        Ex_Rs.close 
end sub 
'返回本頁要用到的記錄集 
public function execute 
        ids 
        Ex_Sql=Ex_Columns&" "&Ex_dataFrom&" "&Ex_strWhere&" and id in("&Ex_ids&") "&Ex_order 
        Ex_Rs.open Ex_Sql,Ex_conn,1,1 
        Set execute=Ex_Rs 
end function 
end class 
%>

相關(guān)文章

  • ASP 類 Class入門

    ASP 類 Class入門

    我們常??吹絼e的程序語言中中都有類的說明,PHP,VB,C++,這個(gè)在VBScript中的類的說明,我是第一次聽到,我們的日常工作就是網(wǎng)站開發(fā),在這個(gè)里面多多少少搞出點(diǎn)經(jīng)驗(yàn),像模像樣也能自詡為"內(nèi)行",所以我就來分享一下我所知道的這個(gè)新的東東
    2006-07-07
  • ASP中一個(gè)用VBScript寫的隨機(jī)數(shù)類

    ASP中一個(gè)用VBScript寫的隨機(jī)數(shù)類

    ASP中一個(gè)用VBScript寫的隨機(jī)數(shù)類...
    2006-08-08
  • 最新評(píng)論