If you connect the database, you will not write, from the beginning of the text: <% DIM RSDIM SQLMSG_PER_PAGE = 5 'Defines each page display record number SET RS = Server.createObject ("AdoDb.Recordset") SQL = "SELECT * from GBOOK ORDER BY ID DESC "'Change into your own SQL statement rs.cursorlocation = 3' Using the client game," can enhance the efficiency RS.Pagesize = MSG_PER_PAGE 'Defined Paging Recording Collection RS.Open SQL, CONN, 0, 1 IF Err.Number <> 0 THEN 'error handling response.write "database operation failed:" & Err.Descriptionerr.clearelseif Not (rs.eof and rs.bof) Then' detection record set is empty TotalRec = rs.Recordcount 'TotalRec : Total number of records IF = = 0 THEN 'calculation total number, recordcount: Data total record number n = rRS.Recordcount / msg_per_page' N: Total page ELSE n = = = = = = = = = = = end if currentpage = request ( "page") 'currentpage: this page If currentpage <> "" thencurrentpage = cint (currentpage) if currentpage <1 then currentpage = 1end if if err.number <> 0 then err.clearcurrentpage = 1end ifelsecurrentpage = 1End if if currentpage * msg_per_page> totalrec and not ((currentpage-1) * msg_per_page