이 심 asp 페이지 클래스 v 1.0
4253 단어 이 심 asp 페이지 클래스v1.0
<%
class Ex_SplitPageCls
'==========================================================================
' asp v1.0
' : QQ:343931221
' www.ex123.net www.bo56.com
' :www.ex123.net/show/page
'
'==========================================================================
dim Ex_Rs
dim Ex_columns'
dim Ex_datafrom'
dim Ex_strWhere'
dim Ex_order'sql
dim Ex_idcount'
dim Ex_pageSize'
dim Ex_pageCount'
dim Ex_ids' id
dim Ex_Sql' sql
dim Ex_page'
dim Ex_Conn'
dim Ex_index'
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 from
public property let letDataFrom(str)
Ex_dataFrom=str
end property
' :sql order by
public property let letOrder(str)
Ex_order=str
end property
' :
public property let letPageSize(str)
Ex_pageSize=str
end property
' :
public property let letPage(str)
Ex_page=str
end property
' :
public property let letId(str)
Ex_Id=str
end property
' :
public property get getRsCount
getRsCount=Ex_idCount
end property
' :
public property get getPageCount
if(Ex_idcount>0) then' =0,
if(Ex_idcount mod Ex_pageSize=0)then' , = / +1
Ex_pageCount=int(Ex_idcount/Ex_pageSize)'
else
Ex_pagecount=int(Ex_idcount/Ex_pageSize)+1'
end if
getPageCount=Ex_pagecount
else
getPageCount=0
end if
end property
' :
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 '
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
%>