<% Remote ---------------------------------- Rem author: Wang Qunjun qinjunit@yahoo.comRem creation date : 2004-10-12Rem Modified Date: Monday, January 24, 2005 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---
'Function Practical Data Page Display Function' Parameters: Datasql ----------- Current page data 'parameter: countsql ----------- SQL statement of the number of queries 'Parameters: Page ----------- Which page parameter: Pagesize ----------- Page' parameters: THEADSTRINGS ------- Display the title column name Definition, separated by ",", corresponding to the column name inside Datasql. 'Example: =============================================================! - # include virtual = "Inc / conn.asp" -> '' <% 'DIM ipageSize, CURPAGE' ipageSize = 18 'CURPAGE = 1'if (Request .Form <> ") THEN 'IF ISEMPTY (Request.form (" P ")) THEN' CURPAGE = 1 'Elseif IsNumeric (Request.form (" P ")) THEN' CURPAGE = Clng (Request.form" p ")) 'end if'end if'ShowRecords" exec p_show accounts, "& iPageSize &", "& CurPage &",' account_code, account_password, account_serial, account_type, account_money, stock_time ' "," select count (account_code) as total from [ Accounts] ", ClNG (CURPAGE), IPAGESIZE," Card number, password, serial number, card type, card amount, storage time "
'Closedb ()'%> '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' 'Sub Showrecords (Datasql, Countsql, Page, PageSize, Modelstrings, THEADSTRINGS) DIM TOTAL, RS, DATMESSAGES DIM USDATAMODEL IF (Request.form ("Pagertotal") <> " ). = clng (Request.form ("PagertAl")) Else Total = conn.execute (countsql) (0) end if if len (modelstrings) <8 TEN 'template length is defined as 8 useDataModel = false else UsedataModel = True end if DatMessages = DatMessages & "
"DatMessages = DatMess &" DatMesName = "" frMpager "" id = "" frmpager "" method = "" "" "" "" = " (total) <> 0 THEN 'SET RS = conn.execute (Datasql) Rem Non-Store Procedure Pagmon ===================== SET RS = Server.createObject (" Adodb.recordset ") RS.Open Datasql, Conn, 1, 1 rs.pageSize = PageSize ======================================================== ==========
DIM THARRAY, COLCOUNT, K, THSTR, I = 1 'Initialization Repector Colcount = rs.fields.count' Gets Total Column IF NOTADATAMODEL THEN 'Does not use Template Operation IF Len (THEADSTRINGS) <1 Then for K = 0 TO (RS.fields.count-1) THSTR = Thstr & rs.fields (k) .name & "" Next Tharray = Split ((MID (THSTR, 1, LEN (THSTR) -1)), "," Else Tharray = Split (THEADSTRINGS, ",") END IF
DatMessages = DatMess & "
" for k = 0 TO (Colcount-1) DatMessages = Datmessages & "" & Tharray (k) & " th > "Next Datmessages = DatMessages &" TR> "Else Datmessages = Datmessages &" |
"END IF
'--------- Data cycle start ------------' While (Not Rs.eof and i " else datmessages = DatMessages & "" END IF
For k = 0 to (colcount-1) DatMessages = DatMessages & " " & RS (K) & " TD>" Next Datmessages = Datmessages & " TR>" Else 'Batch replacement mode data DIM OneNotestring OneNotestring = Modelstrings for K = 0 TO (Colcount-1) IF ISNULL (RS (k)) ThenNotestring = Replace (OneNotestring, "{$ Data #" & (K 1) & "}", "") else OneNotestring = Replace (OneNotestring, "{$ Data #" & (K 1) & "}", HTMLSTRING (RS (K))) end if next datmessages = datimentages & livenotestring end if i = i 1 rs.movenext Wend RS. Close () SET RS = Nothing '---------- Data cycle end -----------'
IF not usedataModel the datmessages = datimentages & " | & data_pager (total (total, page, pagesize) & " td> tr>" else datmessages = DatMessages & " td> tr> & Data_Pager (Total (Total, Page, PageSize) &" td> tr> "endiff Else Datmessages = DatMessages & " | " "align =" "" "" "" "" "" "" "" "" "" " "Middle"> No requirements data td> tr> "end if Datmessages = DatMessages &" form> table> "response.write (datmessages) End Sub
Function Data_Pager (Total, Curpage, Pagesize) '' '' '' '' '' '' '' '' '' '' '' 'DIM JSGOFunction JSGOFunction = " | | |