|
set conn=server.CreateObject("adodb.connection") conn.open connstr errMsg "连接数据库" End Sub '类结束 Private Sub Class_terminate() conn.close set conn=nothing End Sub '------------------------------------------------------------------------- '给类的变量设置值 '------------------------------------------------------------------------- '设置sql语句 Public Property Let sqlStr(Byval Values) strsql=Values End Property '设置查询分页的表名 public property let tbName(Byval Values) vTbName=Values end property '-------------------------------------------------------- '设置查询分页的表的主键 public property let pKey(ByVal Values) vPKey=Values end property '-------------------------------------------------------- '设置显示的字段 public property let pgFields(ByVal Values) vPgFields=Values end property '-------------------------------------------------------- '设置每页显示的记录数 public property let pgSize(ByVal Values) vPgSize=Values end property '--------------------------------------------------------- '设置当前显示的页数 public property let currPg(ByVal Values) vCurrPg=Values end property '-------------------------------------------------------- '设置查询的条件 public property let conditions(ByVal Values) if Len(Values)>0 then vConditions=" where "&Values else vConditions=" where 1=1 " end if end property '------------------------------------------------------- '设置查询的排序 public property let orderBy(ByVal Values) if Len(Values)>0 then vOrderBy=" order by "&Values else vOrderBy=Values end if end property '------------------------------------------------------------- '得到记录总数 public property get vRsCount() if vCurrPg=1 then sqlc="select count("&vPKey&") as Idcount from "&vTbName&" "&vConditions set rsc=server.CreateObject("adodb.recordset") |
|
【收藏】【打印】【进入论坛】 |
|
|
|
|
|
|
|