|
set conn=server.CreateObject("adodb.connection") conn.open connstr errMsg "連接數(shù)據(jù)庫(kù)" End Sub '類(lèi)結(jié)束 Private Sub Class_terminate() conn.close set conn=nothing End Sub '------------------------------------------------------------------------- '給類(lèi)的變量設(shè)置值 '------------------------------------------------------------------------- '設(shè)置sql語(yǔ)句 Public Property Let sqlStr(Byval Values) strsql=Values End Property '設(shè)置查詢(xún)分頁(yè)的表名 public property let tbName(Byval Values) vTbName=Values end property '-------------------------------------------------------- '設(shè)置查詢(xún)分頁(yè)的表的主鍵 public property let pKey(ByVal Values) vPKey=Values end property '-------------------------------------------------------- '設(shè)置顯示的字段 public property let pgFields(ByVal Values) vPgFields=Values end property '-------------------------------------------------------- '設(shè)置每頁(yè)顯示的記錄數(shù) public property let pgSize(ByVal Values) vPgSize=Values end property '--------------------------------------------------------- '設(shè)置當(dāng)前顯示的頁(yè)數(shù) public property let currPg(ByVal Values) vCurrPg=Values end property '-------------------------------------------------------- '設(shè)置查詢(xún)的條件 public property let conditions(ByVal Values) if Len(Values)>0 then vConditions=" where "&Values else vConditions=" where 1=1 " end if end property '------------------------------------------------------- '設(shè)置查詢(xún)的排序 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頁(yè),當(dāng)前在第 2頁(yè) 1 2 3 4 5 |
|
【收藏】【打印】【進(jìn)入論壇】 |
|
|
|
|
|
|
|