469,333 Members | 4,490 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,333 developers. It's quick & easy.

Pagination Script Problem

I have used the following Pagination script to display database records in a series of pages, but only the first page shows up properly, and on clicking the links of subsequent pages or the NEXT , LAST page links, No records are displayed but only the Message - "Sorry, No records Found!!".shows up.
I guess some form fields values which contain multiple strings with spaces between them are not properly collected into the variables in the ASP Action Page i.e. the page where the records are displayed. Please provide a solution.
The script is given below :
Expand|Select|Wrap|Line Numbers
  1. <%@LANGUAGE="VBSCRIPT"%>
  2. <%Response.Buffer = True%>
  3. <!---#include file ="config.asp"--->
  4. <% CheckAdmin() 
  5.     action=Request.QueryString("action")
  6.     dim counterstart
  7.       dim counterend
  8.       dim page_size 
  9.       dim cur_page
  10.       dim first_page
  11.       dim pre_page
  12.       dim next_page
  13.       dim last_page
  14.       dim page_count
  15.       page_size = pagesize 
  16.  
  17. 'set Recordset1 = Server.CreateObject("ADODB.Recordset")
  18. 'Recordset1.ActiveConnection = DBPath
  19.  
  20. Dim pageName 'Asp Page Name
  21. Dim Search ' search term duhhh!
  22. Dim Table ' The field that we are searching for
  23. Dim Order ' Sort desc or asc
  24. Dim Person ' Pesonal or web details search
  25. Dim SortOrder
  26. PageName="view_tender.asp"
  27.  
  28. Search = Request.querystring("search")
  29. Table = request.querystring("Table")
  30.  
  31. SortOrder = Request.querystring("SortOrder")
  32.  
  33. If (SortOrder = "") then sortOrder = Table
  34. 'If 
  35. If (Person = "") then Person = "personal"
  36.  
  37. searchby = request.querystring("searchby")
  38. 'Order = request.querystring("order")
  39. Order = "desc"
  40. sortorder ="id"
  41. 'SortOrder = request.querystring("SortOrder")
  42.  
  43. '###### Search Recordset ADAM remember this #######
  44.  
  45. set Recordset1 = Server.CreateObject("ADODB.Recordset")
  46. Recordset1.ActiveConnection = dbpath
  47. if session("lvl")=100 then 
  48.     If Search = "" then 
  49.         If (sortorder = "") then sortorder ="todt"
  50.         Recordset1.Source = "SELECT * FROM tenders ORDER BY "&SortOrder&" "& Order
  51.     Else ' we do a search
  52.         Recordset1.Source = "SELECT * FROM tenders WHERE "&Table&" LIKE '%"&Search&"%' ORDER BY "&SortOrder&" "&Order
  53.     End if
  54. Else
  55.     If Search = "" then 
  56.         If (sortorder = "") then sortorder ="todt"
  57.         Recordset1.Source = "SELECT * FROM tenders WHERE deptId ="& session("deptId") &" ORDER BY "&SortOrder&" "& Order
  58.     Else ' we do a search
  59.         Recordset1.Source = "SELECT * FROM tenders WHERE deptId ="& session("deptId") &" and "&Table&" LIKE '%"&Search&"%' ORDER BY "&SortOrder&" "&Order
  60.     End if
  61. End if
  62.  
  63. 'Recordset1.Source = "Select * from logad"
  64.  
  65. Recordset1.CursorType = 0
  66. Recordset1.CursorLocation = 3
  67. Recordset1.cachesize = 5
  68. Recordset1.LockType = 3
  69. Recordset1.Open
  70. If Err.number <> 0 then
  71.    Recordset1.ActiveConnection.Close 
  72.    Set Recordset1 = Nothing
  73.    checkError()
  74. End if
  75.  
  76. If Recordset1.eof=false then
  77.       Recordset1.PageSize = page_size
  78.       page_count = Recordset1.PageCount
  79.     cur_page= Cint(Request.QueryString("page"))
  80.       if cur_page= "" or cur_page < 1 then
  81.          cur_page = 1
  82.       end if
  83.       Recordset1.AbsolutePage=cur_page
  84.  
  85.  
  86. %>
  87. <html>
  88. <head>
  89. <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
  90. <meta name="ProgId" content="FrontPage.Editor.Document">
  91. <META name="keywords" content="<%=sitekeywords%>">
  92. <META name="language" content="English">
  93. <META name="author" content="Webx">
  94. <META name="copyright" content="Webx">
  95. <META name="robots" content="INDEX, FOLLOW">
  96. <META name="revisit-after" content="10 days">
  97. <META name="document-class" content="Completed">
  98. <META name="document-classification" content="Online Content Management">
  99. <META name="document-rights" content="Copyrighted Work">
  100. <META name="document-type" content="Web Page">
  101. <META name="document-rating" content="Safe for Kids">
  102. <META name="document-distribution" content="Global">
  103. <META name="document-state" content="dynamic">
  104. <META name="cache-control" content="no-cache">
  105. <META name="Abstract" content="Rural Works">
  106. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  107. <title><%=siteTitle%></title>
  108. </head>
  109.  
  110. <body>
  111. <script language="JavaScript">
  112. function ConfirmDelete() 
  113. {
  114.   var confirm_del = window.confirm ("Do you really want to delete?");
  115.   if (confirm_del) 
  116.   {
  117.   document.forms[1].submit();
  118.   }
  119. }
  120.  
  121. function CheckAll(chk)
  122. {
  123. for (var i=0;i < document.forms[1].elements.length;i++)
  124.     {
  125.         var e = document.forms[1].elements[i];
  126.         if (e.type == "checkbox")
  127.         {
  128.             e.checked = chk.checked;
  129.         }
  130.     }
  131. }
  132. </script>
  133. <%if recordset1.eof=false then%>
  134. <div align="center">
  135.   <center>
  136.   <table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="700" id="AutoNumber1" cellpadding="0" height="485">
  137.     <tr>
  138.       <td width="3%">
  139.       <font face="Verdana" size="1">&nbsp;</font></td>
  140.       <td width="94%" colspan="2">
  141.       <font face="Verdana" size="1">&nbsp;</font></td>
  142.       <td width="3%">
  143.       <font face="Verdana" size="1">&nbsp;</font></td>
  144.     </tr>
  145.     <tr>
  146.       <td width="3%" bgcolor="#800000" height="20">
  147.       <img border="0" src="Images/cornerleft.jpg"></td>
  148.       <td width="94%" bgcolor="#800000" height="20" colspan="2">
  149.       <p align="center"><b><font size="2" face="Verdana" color="#FFFFFF">
  150.       Administration Area</font></b></td>
  151.       <td width="3%" bgcolor="#800000" height="20">
  152.       <p align="right">
  153.       <img border="0" src="Images/cornerright.jpg"></td>
  154.     </tr>
  155.     <tr>
  156.       <td width="50%" colspan="2" bgcolor="#800000" height="28">
  157.       <p style="margin-left: 15"><b>
  158.       <font face="Verdana" size="1" color="#FFFFFF">Welcome <%=Request.Cookies("Admin_Name")%></font></b></td>
  159.       <td width="50%" colspan="2" bgcolor="#800000" height="28">
  160.       <p align="right" style="margin-right: 10"><b>
  161.       <font face="Verdana" size="1" color="#FFFFFF"><a href="adminMain.asp">
  162.       <font color="#FFFFFF">Home</font></a> | <a href="LOGOUT.ASP">
  163.       <font color="#FFFFFF">Logoff</font></a> </font></b></td>
  164.     </tr>
  165.     <tr>
  166.       <td width="100%" colspan="4" bgcolor="#EFEFEF" height="36" style="border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#800000">
  167.       <!---#include file ="toplink.asp"--->
  168.       </td>
  169.     </tr>
  170.     <tr>
  171.       <td width="100%" colspan="4" height="344" style="border-style: solid; border-width: 1" bordercolor="#800000" valign="top">
  172.       <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
  173.         <tr>
  174.           <td width="100%">
  175.           <form method="GET" action="<%=pagename%>">
  176.            <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber6">
  177.               <tr>
  178.                 <td width="25%"><b><font face="Verdana" size="1">&nbsp;</font></b></td>
  179.                 <td width="25%"><font face="Verdana" size="1">&nbsp;</font></td>
  180.                 <td width="25%"><font face="Verdana" size="1">&nbsp;</font></td>
  181.                 <td width="25%"><font face="Verdana" size="1">&nbsp;</font></td>
  182.               </tr>
  183.               <tr>
  184.                 <td width="25%">
  185.                 <p align="right"><b><font size="1" face="Verdana">Sort By:
  186.                 </font></b></td>
  187.                 <td width="25%">
  188.                 <p align="center"> 
  189.     <select name="table" style="font-size: 8pt; font-family: Verdana; color: #800000">
  190.       <option value="tenderno" selected>Tender No</option>
  191.       <option value="nameWork">Tender Description</option>
  192.       <option value="todt">Opening Date</option>
  193.       <option value="department">Department</option>
  194.     </select></td>
  195.                 <td width="25%"> 
  196.     <input type="text" name="search" size="20" style="font-size: 8pt; font-family: Verdana; color: #800000; border: 1px solid #800000"></td>
  197.                 <td width="25%">
  198.         <input type="submit" value="Search" name="B1" style="font-size: 10pt; font-family: Verdana; color: #FFFFFF; font-weight: bold; border-style: solid; border-width: 1; background-color: #800000"></td>
  199.               </tr>
  200.             </table>
  201.           </form>
  202.           </td>
  203.         </tr>
  204.       </table>
Dec 15 '07 #1
5 1642
jhardman
3,406 Expert 2GB
continued from above:
Expand|Select|Wrap|Line Numbers
  1.       <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3">
  2.         <tr>
  3.           <td width="100%">
  4.       <form method="POST" action="view_tender_action.asp">
  5.         <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber4">
  6.           <tr>
  7.             <td width="100%" colspan="4" bgcolor="#800000"><b>
  8.             <font face="Verdana" size="1" color="#FFFFFF">&nbsp;Tender&nbsp; Details 
  9.             - All Active Tenders</font></b></td>
  10.           </tr>
  11.           <tr>
  12.             <td width="100%" colspan="4">
  13.             <p align="center"><font face="Verdana" size="1">&nbsp;<font color="#FF0000"><b><%=request.queryString("strErr")%></b></font></font></td>
  14.           </tr>
  15.           <tr>
  16.             <td width="9%" bgcolor="#EFEFEF">
  17.             <p style="margin-left: 15"><font face="Verdana" size="1">&nbsp;<input type="checkbox" name="selectAll" onclick=CheckAll(this) value="ON"></font></td>
  18.             <td width="91%" bgcolor="#EFEFEF" colspan="3"><b><font face="Verdana" size="1">
  19.             &nbsp;Select All</font></b></td>
  20.           </tr>
  21.           <tr>
  22.             <td width="100%" colspan="4"><font face="Verdana" size="1">&nbsp;</font></td>
  23.           </tr>
  24.           <tr>
  25.             <td width="100%" colspan="4">
  26.             <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber5" height="53">
  27.               <tr>
  28.                 <td width="9%" bgcolor="#800000" height="12">
  29.                 <p align="center"><b>
  30.                 <font face="Verdana" size="1" color="#FFFFFF">Delete</font></b></td>
  31.                 <td width="8%" bgcolor="#800000" height="12"><p align="center">
  32.                 <font face="Verdana" size="1" color="#FFFFFF"><b>&nbsp;Action</font></b></td>
  33.                 <td width="14%" bgcolor="#800000" height="12">
  34.                 <font face="Verdana" size="1" color="#FFFFFF"><b>&nbsp;Issue Date</b></font></td>
  35.                 <td width="13%" bgcolor="#800000" height="12">
  36.                 <font face="Verdana" size="1" color="#FFFFFF"><b>&nbsp;Tender No.</b></font></td>
  37.                 <td width="29%" bgcolor="#800000" height="12">
  38.                 <font face="Verdana" size="1" color="#FFFFFF"><b>&nbsp;Description</b></font></td>
  39.                 <td width="13%" bgcolor="#800000" height="12">
  40.                 <font face="Verdana" size="1" color="#FFFFFF"><b>&nbsp;Due Date</b></font></td>
  41.                 <td width="37%" bgcolor="#800000" height="12">
  42.                 <font face="Verdana" size="1" color="#FFFFFF"><b>&nbsp;Click for Details</b></font></td>
  43.               </tr>
  44.                <%
  45.                linkpage = ""
  46.                do while recordset1.Absolutepage=cur_page and recordset1.Eof = false
  47.                %>
  48.               <tr>
  49.                 <td width="9%" bgcolor="#EFEFEF" height="20">
  50.                 <p align="center"><font size="1" face="Verdana">
  51.                 <input type="checkbox" name="delete" value="<%=(Recordset1.Fields.Item("id").Value)%>"></font></td>
  52.                 <td width="8%" bgcolor="#EFEFEF" height="20">
  53.                 <p align="center"><b><font size="1" face="Verdana">
  54.                 <a href="edit_tender.asp?pg=<%=pagename%>&id=<%=(Recordset1.Fields.Item("Id").Value)%>">
  55.                 <font color="#000000">Edit</font></a></font></b></td>
  56.                 <%tdd=day(Recordset1.Fields.Item("tenderDt").Value)
  57.                   tmm=month(Recordset1.Fields.Item("tenderDt").Value)
  58.                 tyy=Year(Recordset1.Fields.Item("tenderDt").Value)
  59.                 tdate=tdd & "/" & tmm & "/" & tyy
  60.                 %>
  61.  
  62.                 <td width="14%" bgcolor="#EFEFEF" height="20">
  63.                 <p style="margin-left: 5"><font face="Verdana" size="1"><%=tdate%></font></td>
  64.                 <td width="13%" bgcolor="#EFEFEF" height="20">
  65.                 <p style="margin-left: 5"><font face="Verdana" size="1"><%=(Recordset1.Fields.Item("tenderNo").Value)%></font></td>
  66.                 <td width="29%" bgcolor="#EFEFEF" height="20">
  67.                 <p style="margin-left: 5"><font face="Verdana" size="1"><%=(Recordset1.Fields.Item("ShortDesc").Value)%></font></td>
  68.                 <%dd=day(Recordset1.Fields.Item("ToDt").Value)
  69.                 mm=month(Recordset1.Fields.Item("ToDt").Value)
  70.                 yy=Year(Recordset1.Fields.Item("ToDt").Value)
  71.                 tdate1=dd & "/" & mm & "/" & yy
  72.  
  73.                 if isNull(recordset1("tenderPath")) = true or trim(recordset1("tenderPath")) = "" then
  74.                     linkPage="tender_det.asp"
  75.                 else
  76.                     linkPage="tender_details.asp"
  77.                 end if
  78.                 %>
  79.  
  80.                 <td width="13%" bgcolor="#EFEFEF" height="20">
  81.                 <p style="margin-left: 5"><font face="Verdana" size="1"><%=tdate1%></font></td>
  82.                 <td width="37%" bgcolor="#EFEFEF" height="20">
  83.                 <p style="margin-left: 5">
  84.                 <font face="Verdana" size="1">
  85.                 <b>
  86.                 <a href="<%=linkPage%>?id=<%=(Recordset1.Fields.Item("Id").Value)%>">
  87.                 <font color="#000000">Details</font> </a></b></font></td>
  88.               </tr>
  89.                <%
  90.                Recordset1.MoveNext()
  91.                loop
  92.                Recordset1.close()
  93.                Set Recordset1 = nothing
  94.                end if
  95.                %>
  96.                <tr>
  97.                 <td width="9%" bgcolor="#800000" height="12"><font size="1" face="Verdana">&nbsp;</font></td>
  98.                 <td width="8%" bgcolor="#800000" height="12"><font face="Verdana" size="1">&nbsp;</font></td>
  99.                 <td width="14%" bgcolor="#800000" height="12"><font face="Verdana" size="1">
  100.                 &nbsp;</font></td>
  101.                 <td width="13%" bgcolor="#800000" height="12"><font face="Verdana" size="1">
  102.                 &nbsp;</font></td>
  103.                 <td width="29%" bgcolor="#800000" height="12"><font face="Verdana" size="1">
  104.                 &nbsp;</font></td>
  105.                 <td width="13%" bgcolor="#800000" height="12"><font face="Verdana" size="1">
  106.                 &nbsp;</font></td>
  107.                 <td width="37%" bgcolor="#800000" height="12"><font size="1">&nbsp;</font></td>
  108.               </tr>
  109.             </table>
  110.             </td>
  111.           </tr>
  112.           <tr>
  113.             <td width="9%"><font face="Verdana" size="1">&nbsp;</font></td>
  114.             <td width="32%"><font face="Verdana" size="1">&nbsp;</font></td>
  115.             <td width="34%"><font face="Verdana" size="1">&nbsp;</font></td>
  116.             <td width="25%"><font face="Verdana" size="1">&nbsp;</font></td>
  117.           </tr>
  118.           <tr>
  119.             <td width="9%" bgcolor="#EFEFEF">
  120.             <p align="center"><font face="Verdana" size="1">
  121.             <input type="checkbox" name="selectAll1" onclick=CheckAll(this) value="ON"></font></td>
  122.             <td width="91%" bgcolor="#EFEFEF" colspan="3"><b><font face="Verdana" size="1">
  123.             Select All</font></b></td>
  124.           </tr>
  125.           <tr>
  126.             <td width="100%" colspan="4">
  127.             <p align="center"><b><font face="Verdana" size="1"><%call navBar1()%></font></b></td>
  128.           </tr>
  129.         </table>
Dec 17 '07 #2
jhardman
3,406 Expert 2GB
continued from above:
Expand|Select|Wrap|Line Numbers
  1.         <p align="center">
  2.         <input type="button" value="Delete" name="B1" OnClick="ConfirmDelete()" style="font-size: 10pt; font-family: Verdana; color: #FFFFFF; font-weight: bold; border-style: solid; border-width: 1; background-color: #800000">
  3.         <input type="reset" value="Reset" name="B2" style="font-size: 10pt; font-family: Verdana; color: #FFFFFF; font-weight: bold; border-style: solid; border-width: 1; background-color: #800000"></p>
  4.         <input type="hidden" value="<%=pageName%>" name="pageName">
  5.         </form>
  6.           <p>&nbsp;</td>
  7.         </tr>
  8.       </table>
  9.       </td>
  10.     </tr>
  11.     <tr>
  12.       <td width="45%" colspan="2" height="19" bgcolor="#EFEFEF" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#800000">
  13.       <p style="margin-left:15; margin-top:0; margin-bottom:0"><b>
  14.       <font size="1" face="Verdana" color="#800000">Admin Module Version 1.0</font></b></td>
  15.       <td width="55%" colspan="2" height="19" bgcolor="#EFEFEF" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#800000">
  16.       <p style="margin-right: 15; margin-top: 0; margin-bottom: 0" align="right"><b>
  17.       <font face="Verdana" size="1" color="#800000">Powered By: 
  18.       <a href="http://www.webxindia.com"><font color="#800000">WebX</font></a></font></b></td>
  19.     </tr>
  20.     <tr>
  21.       <td width="100%" colspan="4" height="20" style="border-top-style: solid; border-top-width: 1">&nbsp;</td>
  22.     </tr>
  23.   </table>
  24.   </center>
  25. </div>
  26. <% 
  27. Else
  28. if request.queryString("strErr") = "" then
  29.     DispErr= "Sorry No Records Found!!"
  30. Else
  31.     DispErr = request.queryString("strErr")
  32. End if
  33.  
  34. %>
  35.        <center>
  36.             <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="700" id="AutoNumber7">
  37.               <tr>
  38.                 <td width="20" bgcolor="#800000">
  39.       <img border="0" src="Images/cornerleft.jpg"></td>
  40.                 <td width="660" bgcolor="#800000">
  41.                 <p align="center"><b>
  42.                 <font color="#FFFFFF" size="2" face="Verdana">Information</font></b></td>
  43.                 <td width="20">
  44.                 <p align="right">
  45.                 <img border="0" src="Images/cornerright.jpg"></td>
  46.               </tr>
  47.               <tr>
  48.                 <td width="20" bgcolor="#EFEFEF" bordercolor="#800000" style="border-left-style: solid; border-left-width: 1">&nbsp;</td>
  49.                 <td width="660" bgcolor="#EFEFEF">&nbsp;</td>
  50.                 <td width="20" bgcolor="#EFEFEF" bordercolor="#800000" style="border-right-style: solid; border-right-width: 1">&nbsp;</td>
  51.               </tr>
  52.               <tr>
  53.                 <td width="20" bordercolor="#800000" style="border-left-style: solid; border-left-width: 1">&nbsp;</td>
  54.                 <td width="660">&nbsp;</td>
  55.                 <td width="20" bordercolor="#800000" style="border-right-style: solid; border-right-width: 1">&nbsp;</td>
  56.               </tr>
  57.               <tr>
  58.                 <td width="20" bordercolor="#800000" style="border-left-style: solid; border-left-width: 1">&nbsp;</td>
  59.                 <td width="660">
  60.                 <p align="center"><font size="2" face="Verdana" color="#800000"><b><%=dispErr%></b></td>
  61.                 <td width="20" bordercolor="#800000" style="border-right-style: solid; border-right-width: 1">&nbsp;</td>
  62.               </tr>
  63.               <tr>
  64.                 <td width="20" bordercolor="#800000" style="border-left-style: solid; border-left-width: 1">&nbsp;</td>
  65.                 <td width="660">&nbsp;</td>
  66.                 <td width="20" bordercolor="#800000" style="border-right-style: solid; border-right-width: 1">&nbsp;</td>
  67.               </tr>
  68.               <tr>
  69.                 <td width="20" bordercolor="#800000" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" bgcolor="#EFEFEF">&nbsp;</td>
  70.                 <td width="660" bgcolor="#EFEFEF" bordercolor="#800000" style="border-bottom-style: solid; border-bottom-width: 1">&nbsp;</td>
  71.                 <td width="20" bgcolor="#EFEFEF" bordercolor="#800000" style="border-right-style: solid; border-right-width: 1; border-bottom-style: solid; border-bottom-width: 1">&nbsp;</td>
  72.               </tr>
  73.             </table>
  74.             <font size="2" face="Verdana"></center>
  75.         <%
  76.             Recordset1.close()
  77.             Set Recordset1 = Nothing
  78.             Response.end 
  79.         end if 
  80. %>
  81. <%sub navBar1()
  82. 'Counter for paging loop
  83.     if(cur_page mod 10)= 0 then
  84.             counterstart = cur_page - 9
  85.         else
  86.             counterstart = cur_page - (cur_page mod 10) + 1
  87.         end if
  88.             counterend = counterstart + 9
  89.  
  90.         if counterend >= page_count then
  91.             counterend=Page_count
  92.         end if
  93.  
  94. 'For Last
  95.     last_page=page_count
  96. 'For next page
  97.     if ( (counterstart + 10) <= page_count )then
  98.       next_page= counterstart + 10
  99.     end if
  100. 'First page
  101.       first_page=1
  102. 'Previous Page
  103.     if counterstart > 10 then
  104.       pre_page = counterstart - 10 
  105.     end if    
  106.  
  107. 'paging string    
  108.     strpage=""
  109.      for k=counterstart to counterend step 1
  110.      if counterstart < page_count or  counterstart = page_count then    
  111.           if k = cur_page then
  112.                 strpage = strpage &"&nbsp;"& k
  113.             else
  114.                 strpage = strpage & "&nbsp;<A href="& pageName &"?table="& table & "&search="& search & "&action=showAll&page="& k 
  115.                 strpage = strpage & ">" & k & "</A>"
  116.           end if
  117.    end if
  118.   next
  119.  
  120.  
  121.   '///////////////////////
  122.   'first
  123.   if  cur_page <> 1 then
  124.     str1="<A href="& pageName &"?table="& table & "&search="& search & "&action=showAll&page=1>First</A>&nbsp;:&nbsp;"
  125.   else
  126.     str1=  "First&nbsp;:&nbsp;"
  127.   end if
  128.  
  129.   'previous
  130.   if counterstart < 10 then
  131.      str1= str1 &"Previous"
  132.   else
  133.     str1= str1 &"<A href="& pageName &"?table="& table & "&search="& search & "&action=showAll&page="& pre_page &">Previous</A>"
  134.   end if 
  135.  
  136. 'Next
  137.   if counterstart+10 < page_count then
  138.       str2="<A href="& pageName &"?table="& table & "&search="& search & "&action=showAll&page="& next_page &">Next</A>&nbsp;:&nbsp;"
  139.   else
  140.       str2="Next&nbsp;:&nbsp;"
  141.   end if    
  142. 'Last
  143.   if cur_page < page_count then
  144.     str2=str2 &"<A href="& pageName &"?table="& table & "&search="& search & "&action=showAll&page="& last_page &">Last</A>"     
  145.   else
  146.     str2= str2 &"Last"
  147.   end if
  148.   '///////////////////////
  149.  
  150.   'Response.Write "<table width=98% cellpadding=4 cellspacing=1 bgcolor=#663333 >"
  151.   'Response.Write"<tr><td align=right bgcolor=#ffffff >"
  152.   'Response.Write "<FONT face='Verdana, Arial, Helvetica, sans-serif'color=#663333 size=2>"  
  153.   Response.Write str1 & " [ " & strpage & " ] " & str2 &"</font>&nbsp;&nbsp;"
  154.   'Response.Write"</td></tr></table>"
  155.  
  156.   end sub%>
  157.  
  158. </body>
  159.  
  160. </html>
Dec 17 '07 #3
jhardman
3,406 Expert 2GB
you just posted almost 500 lines of code. There is no way I am going to read through it to try to find a problem. Shorten it down to 50 lines and a bunch of psuedo-code and I will look into it.

Jared
Dec 17 '07 #4
Nicodemas
164 Expert 100+
I have a pretty neat piece of VBScript that will page out a resultset using GetRows available for download off my website. Go to The Projects and look for the link there.
Dec 18 '07 #5
jhardman
3,406 Expert 2GB
I have a pretty neat piece of VBScript that will page out a resultset using GetRows available for download off my website. Go to The Projects and look for the link there.
Interested in writing it down in "how-to" article format? this question comes up often enough.

Jared
Dec 18 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by leegold2 | last post: by
2 posts views Thread by Chris H | last post: by
1 post views Thread by dhanu | last post: by
1 post views Thread by Ed Jay | last post: by
1 post views Thread by shalini jain | last post: by
2 posts views Thread by mac | last post: by
16 posts views Thread by gnawz | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.