<% Response.expires = 0 Response.expiresabsolute = Now() - 1 Response.addHeader "pragma", "no-cache" Response.addHeader "cache-control", "private" Response.CacheControl = "no-cache" %> <% displayRecs = 20 recRange = 10 %> <% ' Get table name tablename = "[Table1]" dbwhere = "" a_search = "" b_search = "" %> <% ' Load Default Order DefaultOrder = "" DefaultOrderType = "" ' Check for an Order parameter OrderBy = "" If Request.QueryString("order").Count > 0 Then OrderBy = Request.QueryString("order") ' Check if an ASC/DESC toggle is required If Session("Table1_OB") = OrderBy Then If Session("Table1_OT") = "ASC" Then Session("Table1_OT") = "DESC" Else Session("Table1_OT") = "ASC" End if Else Session("Table1_OT") = "ASC" End If Session("Table1_OB") = OrderBy Session("Table1_REC") = 1 Else OrderBy = Session("Table1_OB") if OrderBy = "" then OrderBy = DefaultOrder Session("Table1_OB") = OrderBy Session("Table1_OT") = DefaultOrderType End If End If ' Check for a START parameter If Request.QueryString("start").Count > 0 Then startRec = Request.QueryString("start") Session("Table1_REC") = startRec Else startRec = Session("Table1_REC") if not isnumeric(startRec) or startRec = "" then 'reset start record counter startRec = 1 Session("Table1_REC") = startRec End If End If ' Open Connection to the database set conn = Server.CreateObject("ADODB.Connection") conn.Open xDb_Conn_Str ' Build Query strsql = "select * from [Table1]" If dbwhere <> "" Then strsql = strsql & " WHERE " & dbwhere End If if OrderBy <> "" then strsql = strsql & " ORDER BY [" & OrderBy & "] " & Session("Table1_OT") end if 'response.write strsql set rs = Server.CreateObject("ADODB.Recordset") rs.Open strsql, conn, 1, 2 totalRecs = rs.RecordCount %> Conservatories, double glazing, uPVC replacement windows | Bournemouth, Christchurch, Poole, Dorset & Hampshire

Conservatories
Doors
Fascias, soffits,
guttering
Windows
FENSA
Insurance

<% 'Avoid starting record > total records if clng(startRec) > clng(totalRecs) then startRec = totalRecs end if 'Set the last record to display stopRec = startRec + displayRecs - 1 'Move to first record directly for performance reason recCount = startRec - 1 if not rs.eof then rs.movefirst rs.move startRec - 1 end if recActual = 0 Do While (NOT rs.EOF) AND (recCount < stopRec) recCount = recCount + 1 If Clng(recCount) >= Clng(startRec) Then recActual = recActual + 1 %> <% 'set row color bgcolor="#FFFFFF" %> <% ' Display alternate color for rows If recCount mod 2 <> 0 Then bgcolor="#F5F5F5" End If %> <% x_ID = rs("ID") x_Product_type = rs("Product type") x_information = rs("information") %> <% end if rs.MoveNext Loop %>
Product ">Offers 
<% response.write x_Product_type %>   <%= replace(x_information & "",chr(10),"
") %> 
<% if totalRecs > 0 then ' Find out if there should be Backward or Forward Buttons on the table. If startRec = 1 Then isPrev = False Else isPrev = True PrevStart = startRec - displayRecs If PrevStart < 1 Then PrevStart = 1 %> <% End If ' Display Page numbers If (isPrev OR (NOT rs.EOF)) Then If (NOT isPrev) Then Response.Write "
" x = 1 y = 1 dx1 = ((startRec-1)\(displayRecs*recRange))*displayRecs*recRange+1 dy1 = ((startRec-1)\(displayRecs*recRange))*recRange+1 If (dx1+displayRecs*recRange-1) > totalRecs then dx2 = (totalRecs\displayRecs)*displayRecs+1 dy2 = (totalRecs\displayRecs)+1 Else dx2 = dx1+displayRecs*recRange-1 dy2 = dy1+recRange-1 End If While x <= totalrecs If x >= dx1 and x <= dx2 Then If Clng(startRec) = Clng(x) Then %> <%=y%> <% Else %> <%=y%> <% End If x = x + displayRecs y = y + 1 elseif x >= (dx1-displayRecs*recRange) and x <= (dx2+displayRecs*recRange) then if x+recRange*displayRecs < totalRecs then %> <%=y%>-<%=y+recRange-1%> <% else ny=(totalRecs-1)\displayRecs+1 if ny = y then %> <%=y%> <% else %> <%=y%>-<%=ny%> <% end if end if x=x+recRange*displayRecs y=y+recRange else x=x+recRange*displayRecs y=y+recRange End If Wend End If ' Next link If NOT rs.EOF Then NextStart = startRec + displayRecs isMore = True %> <% Else isMore = False End If %> <% End If %> <% ' Close recordset and connection rs.Close Set rs = Nothing conn.Close Set conn = Nothing %>
 
 
Re-secure - conservatories, windows & doors serving Bournemouth, Poole, Christchurch and the Dorset & Hampshire counties
497 Christchurch Road, Bournemouth, BH1 4AE
Tel:
Email: enquiries@re-secure.com
© Copyright 2002. All rights reserved. Website optimization by Marketing for Profits Ltd website designers bournemouth