|
set conn=server.CreateObject("adodb.connection") conn.open connstr errMsg "連接數(shù)據(jù)庫" End Sub '類結(jié)束 Private Sub Class_terminate() conn.close set conn=nothing End Sub '------------------------------------------------------------------------- '給類的變量設(shè)置值 '------------------------------------------------------------------------- '設(shè)置sql語句 Public Property Let sqlStr(Byval Values) strsql=Values End Property '設(shè)置查詢分頁的表名 public property let tbName(Byval Values) vTbName=Values end property '-------------------------------------------------------- '設(shè)置查詢分頁的表的主鍵 public property let pKey(ByVal Values) vPKey=Values end property '-------------------------------------------------------- '設(shè)置顯示的字段 public property let pgFields(ByVal Values) vPgFields=Values end property '-------------------------------------------------------- '設(shè)置每頁顯示的記錄數(shù) public property let pgSize(ByVal Values) vPgSize=Values end property '--------------------------------------------------------- '設(shè)置當(dāng)前顯示的頁數(shù) public property let currPg(ByVal Values) vCurrPg=Values end property '-------------------------------------------------------- '設(shè)置查詢的條件 public property let conditions(ByVal Values) if Len(Values)>0 then vConditions=" where "&Values else vConditions=" where 1=1 " end if end property '------------------------------------------------------- '設(shè)置查詢的排序 public property let orderBy(ByVal Values) if Len(Values)>0 then vOrderBy=" order by "&Values else vOrderBy=Values end if end property '------------------------------------------------------------- '得到記錄總數(shù) public property get vRsCount() if vCurrPg=1 then sqlc="select count("&vPKey&") as Idcount from "&vTbName&" "&vConditions set rsc=server.CreateObject("adodb.recordset")本新聞共 5頁,當(dāng)前在第 2頁 1 2 3 4 5 |
|
【收藏】【打印】【進(jìn)入論壇】 |
|
|
|
|
|
|
|