Real page display with ASP

xiaoxiao2021-03-05  23

I. Table Structure Definition: ---- Table Name: Product ---- Table Name: Product ---- Field Name: Product Number: Product_ID ---- Product Name: Product_name II. Function Description: ------ The user enters the product number and does not have to enter a full name. Use a fuzzy query method. Find the record of the condition. Program script ---- The entire program has three ASP files (omitted HTML language section) ---- The entire program has three ASP files (omitted HTML language part) ---- 1 User query data input form: input.asp --- User Enter Product Number

2. One of the paging handles: prod.asp ---- User submit form input.asp After the <% CID = Trim (Request.form ("ID "))%> <% Set rlt = creteObject (" adoDb.recordset ")%> ***** Create a RecordSet object <% sql =" SELECT * from Product Where Product_id Like '"& CID &" ' % '"> <% Rlt.open sql," uid = ncgi; pwd = SQL; DSN = TCGI ", 1%> ****** Execute SQL statement <% if rlt.pagecount <1 THEN%>

No record Return <% else%> ------------------- Arctic Star Library || http://www.ebook007.com ** *** The following display query information: display style: ***** A total of XX page xxx record top number: 1.2.3. 4. 5 ......... share in <% = rlt.pagecount %> Page <% = rlt.recordcount%> Book record page number: <% for i = 1 to rlt.pagecount%> <% CID = rlt ("product_id") & id = <% = CID%>> <% = I%>. <% next%>
<% rlt.pageSize = 20%>

****** The following shows the product list: display style: ****** 1.xxxx ******* ........... < % Rlt.absolute = 1%> <% for i = 1 to rlt.pageSize%> <% if rlt.eof kil = i%>. <% = TRIM (RLT "Product_name")) <% rlt.movenext Next%> <% rlt.close%> 3. Page 2: ProPage.ASP ---- User Selection (Page Number: 1 .2 .3 4. 5 .........) Trigger <% CID = Trim ("ID"))%> <% rlt.absolutepage = request.queryString ("PCNT" )%> ****** The above part is the same as Prod.asp ***** <% for i = 1 to rlt.pageSize%> <% if rlt.eof kil11%>

  • < % = I%>. <% = Trim (rlt ("product_name")) <% rlt.movenext next%> <% rlt.close%> four. Complete and confused; --- You can set the length of each page. The method is to use the session pair of optimist information to receive information: ---- You can set the length of each page. The method is to use the session object to maintain user information to accept user setting information: <% session ("size") = request.form ("size")%> PROD.ASP <% rlt.pageSize = 20%> One sentence Instead <% IF session ("size") = "" "") end if%> Troubleshooting 1. PageSize: Pagesize: Pagesize: Summary: The cursor is positioned to that page. For example, there are 20 records, divided into two pages, and 10 of each page is started from the first record. AbsolutePage = 2 starts from the eleventh record.


  • New Post(0)