:1,列表 2,详情 Public Property Set Conn(v) Set m_DataConn = v End Property Public Property Get Conn Conn = m_DataConn End Property
''返回记录总数 Public Property Get RecordCount RecordCount = m_RecordCount End Property ''返回记录数组 Public Property Get SQLArr SQLArr = m_SQLArr End Property
Rem 公共方法 读取数据 Public Function ReadData If m_CacheType = 1 Then ReadListAndSearchData Else ReadContentData End If End Function Rem 读取详情信息 Private Function ReadContentData Dim xmlfile xmlfile = m_XmlFile If FSOExistsFile(xmlfile) Then ''存在xml缓存,直接从xml中读取 ReadContentDataFromXml xmlfile Else ReadContentDataFromDB End If End Function Rem 从xml文件读取详情信息 Private Function ReadContentDataFromXml(xmlfile) Dim SQLARR() Dim XmlDoc Set XmlDoc = Server.CreateObject("msxml2.FreeThreadedDOMDocument.3.0") XmlDoc.Load xmlfile Dim itemslength,itemsi itemslength = XmlDoc.documentElement.childNodes.length For itemsi=0 To itemslength-1 ReDim Preserve SQLARR(itemslength-1,0) SQLARR(itemsi,0) = XmlDoc.documentElement.childNodes(itemsi).text Next Set XmlDoc = Nothing m_SQLArr = SQLArr End Function Rem 从Db中读取详情信息 Private Function ReadContentDataFromDB() Dim rs Dim SQLARR Set rs = m_DataConn.execute(m_sql) IF Not Rs.eof Then SQLArr=Rs.GetRows(1) rs.close Set rs = Nothing Else rs.close Set rs = Nothing Exit Function End If m_SQLArr = SQLArr End Function
Rem 读取列表数据 Private Function ReadListAndSearchData Dim sPagesize,TotalPage,CurPage,TotalRec sPa |