One page program instance code!

xiaoxiao2021-03-06  81

I learned an ASP paging today, and I also share it with you !! <% 'The following procedure is part of the programming technology article system in my website, highlighting the paging, so other unique code is cleared, you can modify Application 'This page program has a complete example of this page, please log in to my website http://www.lshdic.com' "" THEN PAGE = 1: ELSE: Page = CINT (Request.QueryString ("Page") "Page number in the URL Page =?

Set link1 = server.createObject ("adoDb.connection") 'connection database link1.open "provider = microsoft.jet.oledb.4.0; data source =" & server.mappath ("Database 1.mdb") SET RS = Server .CreateObject ("AdoDb.Recordset") rs.open "Select * from Table 1", link1, 1, 1 'These definition records of cursors and recordings of each page and current page settings, very important rs.pagesize = 12rs.absolution = pageif err.Number <> 0 THEN 'prevented users from maliciously modifying URLs, and database-free error response.write "exception error" Response.Endend IF%>

<% for i = 0 to rs.pageSize-1' Displays the specific data content, i (Page * 13-13) 1 This solution is panelively after displaying the specific number IF RS.EOF kil1n exit forresponse.write "
" & i (Page * 13-13) 1 & ": & RS ("Author) &" "rs.movenextNext%>
<% Pagelen = Split (Request.String ") , "&") 'Get the URL? IF Ubound (Pagelen) <1 THEN' If the URL is XXX.ASP? Page = 1 or XXX.ASP Type of Standard Paging Method IF Page> 1 Then Response.write " Home "

: Else: Response.write "Next" for i = 1 to rs.pagecountif i = Page Ten Response.write I & ": Else: Response.write" " & I & "

IF Page> 1 Then Response.write " Home Next page Last" ": Else: Response.write" next page "for i = 1 to rs.PageCountif i = Page Ten Response.write I &": Else: response.write " " NEXTEND IF' Pagelen (0) is equal to STR1 = Parameter 'Pagelen 1) equal to Page = 1rs.close 'Release Resource SET RS = NothingSet Link1 = Nothing%>


New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.040, SQL: 9