ASP Universal Patement Class 1, the properties of the class, this is an ASP universal paging class. You can use it to make the record integration page, of course, there are many paging classes and paged functions on the Internet. This page mainly has attributes and methods such as CONN, SQL, URL, FIELDLIST, Pagesize, Template, INIT, SHOW, CLOSE. 1.conn attribute: used to get a CONNECTION object that has been created. 2. SQL Property: According to the incoming SQL statement, automatically create the RecordSet object 3.pageSize property: Set the number of records of the record 4.FieldList property: If you need to display the data in the library, be sure to set this property. It is used to get the correct field name that needs to be displayed. 5.url Attribute: Set the file address of the link in the sub-page bar. 6.Template Properties: Set the template of the paging file. 7.init Process: Page Class Initialization Data. 8. SHOW process: Display data. 9.Close Process: Patenclass End All Codes Download II, Source Codes of Class (Inc_Clspage.ASP)
<% '/ *************************************************************** ** '* *' * Name: ASP PAGNATION CLASS * '* Author: cjj *' * Version: V2.8 * '* Time: 2004-01-16 *' * comFrom: http://www.blueidea.com / * '* HomePage: None (Maybe Soon) *' * NOTICE: You can use and modify it freeely, * '* But please Hold this item. *' * If you modify it what I hope you * '* can send a Mail for me. * '* *' *********************************************** ******* / '######### Declaring Variable ########' Defines the display type const sw_intshowCHINESE = 0 'Chinese characters, such as "Previous, next Page "const sw_intshownglish = 1 'English, such as" back, next "const sw_intshowcharacter = 2' special character 'Define data display type const sw_inthorizontalview = 0' horizontal roll const sw_intverticalView = 1 'vertical row 'Line display type Const SW_intShowBigBorder = 2' bold line Const SW_intShowSmallBorder = 1 'thin line Const SW_intShowNoBorder = 0' wireless 'title bar line display type Const SW_intTleSmallBorder = 1' thin line Const SW_intTleNoBorder = 0 'wireless' information display tab Location const sw_intpageinnone = 0 'does not display the page string const SW_INTPAGEINTOP = 1' At top display const sw_intpageinbottom = 2 'At the bottom display const sw_intpageinall = 3' on the top, the number of numbers of numbers of numbers displayed in the bottom display "const Sw_intshowpages = 10 '
SWPage Class Private SW_blnIsHaveRS, SW_strFields, SW_blnInConn, SW_intShowPagePos, SW_strShowWidth '######### initialize variables ########## SW_blnIsHaveRS = false' acquisition flag is set recording settings Fasle, no record is set Status SW_STRSHOWIDTH = "90%" 'default display width is 90% sw_strfields = "" SW_BLNINCONN = true "Create a connection internally, if set to false, create sw_intshowpagePos = sw_intpageinall' ********** ********************************* Type: class' purpose: to record columns set "****** ******************************************** Class Swpage 'declared private variable private sw_objrs, sw_objconn private sw_strsql, sw_strull, SW_strError, SW_strFormAction, SW_strHeadJS, SW_strFootJS Private SW_intPageSize, SW_intTleBDType, SW_intShowPageType, SW_intShowType Private SW_lngTotalPage, SW_lngTotalRecord, SW_lngPageNo Private SW_aryFldName, SW_aryFldNote, SW_aryFldWidth, SW_aryFldAlign, SW_aryFldLink Private SW_blnInit, SW_blnOpenRS, SW_blnConn, SW_blnPageSize, SW_blnFieldList, SW_blnGetURL, SW_blnShowType, SW_blnShowPageType, SW_blnTemplate ' ***************** ************************ The type: attribute 'Purpose: According to the information obtained, create a database connection' input: A_STRCONN: Data Type String ' Return: No '*************************************** Public Property Let Conn a_strConn) Dim strError SW_blnConn = false Set SW_objConn = CreateObject ( "Adodb.Connection") On Error Resume Next SW_objConn.Open a_strConn If Err.Number <> 0 Then strError = strError & "
create a Connection object failed" On Error Goto 0 if Trim (strerror) = ""
THEN SW_BLNCONN = True else sw_strerror = sw_strerror & "
'*************************************** Public property let sql (a_strsql) DIM strError SW_blnOpenRS = false SW_strSQL = a_strSQL 'to create a RecordSet object Set SW_objRS = CreateObject ( "adodb.RecordSet") On Error Resume Next SW_objRS.Open SW_strSQL, SW_objConn, 1,1 If Err.Number <> 0 Then strError = "
Recording set open failed "On Error Goto 0 if Trim (STRERROR) =" "" "# 336699" "# 336699" "Height =" "28">
True else sw_strerror = sw_strerror & "
'************************************************* PUBLIC Property Let Pagesize (a_intpagesize) DIM strError 'pageSize acquisition failure flag SW_blnPageSize = false If Trim (a_intPageSize) = "" OR (Not (IsNumeric (a_intPageSize))) Then strError = strError & "
illegal pagesize" Else If (a_intPageSize <= 2147483647 And a_intPageSize> = -2147483648) Then SW_intPageSize = CLng (a_intPageSize) Else strError = strError & "
PageSize overflow" End If If (SW_intPageSize <= 0) Then strError = strError & "
PageSize can only be a positive integer" End If End If IF TRIM (STRERROR) = "" THEN SW_BLNPAGESIZE = true else sw_strerror = sw_strerror & "t" "" # 336699 "" Height = "" 28 ">
'************************************************* Public property let template (A_STRTEMPLATE) DIM aryTemplate, i, j, strError, strTemp, intItem, aryTemp, aryTemp1 SW_blnTemplate = false aryTemplate = Split (Trim (LCase (a_strTemplate)), " ") intItem = UBound (aryTemplate) If intItem <4 Then strError = "
This property is a must INTEMP = TRIM (Arytemplate (0)) ifTRTEMP (0)) if strtemp = trim (AryTemp, 6), "[file =") = 0 THEN SW_STRHEADJS = "