<% dim grey grey=true iPageSize=5 'How many records To show Dim CPage 'Current Page No. Dim Cn 'Connection Object Dim Rs 'Recordset Object Dim TotPage 'Total No. of pages if iPageSize records are displayed per page. Dim i 'Counter DIM mySQL, objRS DIM objConn Set objConn = Server.CreateObject("ADODB.Connection") 'objconn.CursorLocation = 3 objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("data\brycodata.mdb") & ";" objConn.Open mySQL = "SELECT * FROM reseller_country_list" Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open mySQL, objConn, adOpenKeyset, adLockPessimistic, adCmdText%>
Filter by Country <%Set objRS = Nothing Set objCONN = Nothing %>
<% CPage=Cint(Request.Form("CurrentPage")) 'get CPage value from form's CurrentPage field Select Case Request.Form("Submit") Case "Previous" 'if prev button pressed CPage = Cint(CPage) - 1 'decrease current page Case "Next" 'if next button pressed CPage = Cint(CPage) + 1 'increase page count End Select Set Cn=Server.CreateObject("ADODB.Connection") 'create connection Cn.CursorLocation = 3 Cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("data\brycodata.mdb") & ";" Set Rs=Server.CreateObject("ADODB.Recordset") 'create recordset if request("CID")<>"" then Rs.Open "Select * from reseller_details WHERE reseller_country_code = '" & request("CID") & "' ORDER BY reseller_company ASC",Cn,2,2 else Rs.Open "Select * from reseller_details ORDER BY reseller_company ASC",Cn,2,2 end if Rs.PageSize=iPageSize if CPage=0 Then CPage=1 'initially make current page = first page if Not(Rs.EOF) Then Rs.AbsolutePage=CPage 'specifies that current record resides In CPage TotPage=Rs.PageCount 'stores total no. of pages For i=1 To Rs.PageSize%> bgcolor="#CCCCCC"> <%grey=false else%> bgcolor="#ffffff"> <%grey=true end if%>
<%=rs("reseller_company")%>
.gif" />

<%if rs("reseller_address1")<>"" then response.write(rs("reseller_address1") & "
") end if%>
<%if rs("reseller_address2")<>"" then response.write(rs("reseller_address2") & "
") end if%>
<%if rs("reseller_address3")<>"" then response.write(rs("reseller_address3") & "
") end if%>
<%if rs("reseller_address4")<>"" then response.write(rs("reseller_address4") & "
") end if%>
<%if rs("reseller_address5")<>"" then response.write(rs("reseller_address5") & "
") end if%>
<%if rs("reseller_postcode")<>"" then response.write(rs("reseller_postcode") & "
") end if%>

<%if rs("reseller_buyinstore")<>"" then%> Buy in-store at <%=rs("reseller_buyinstore")%> <%end if%>
 
Tel :
<%=rs("reseller_tel")%>
Fax :
<%=rs("reseller_fax")%>
  " target="blank">
Contact :
<%=rs("reseller_contact")%>
email :
Website :
<% Rs.MoveNext if Rs.EOF Then Exit For Next 'close all connections and recordsets Rs.Close Cn.Close Set Rs = Nothing Set Cn = Nothing %>

<%if totpage>1 then%> Page <%=CPage %> of <%=TotPage %> <%end if%>
" /> " /> " /> <% if CPage > 1 Then %> <% End if%>
<% if CPage <> TotPage Then %> <% End if %>