<% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open Server.MapPath("/") & "\Datacard.mdb" tid = Request.QueryString("tid") uId = "" if tid = "country" then uId = Request.QueryString("cid") elseif tid = "region" then uId = Request.QueryString("rid") end if formatId = Request.QueryString("fid") if Request.QueryString("fid") is nothing or Trim(Request.QueryString("fid")) = "" then Response.Redirect("Datacard2.asp?fid=1&" & "cid=" & uId & "&tid=" & tid) end if if Request.QueryString("fid") = 4 then Response.Redirect("Datacard2.asp?fid=1&" & "cid=" & uId & "&tid=" & tid) end if %>

<% ' get diplays CountryOrRegionTitle = "" set rs = Server.CreateObject("ADODB.recordset") if (tid = "country") then query = "SELECT Country as Display FROM [Countries] " & _ " WHERE " & _ " [Real_Id] = " & uid elseif (tid = "region") then query = "SELECT region as Display FROM [Regions] " & _ " WHERE " & _ " [RegionId] = " & uid end if rs.Open query, conn do until rs.EOF CountryOrRegionTitle = rs.Fields("Display") rs.MoveNext loop set rs = Server.CreateObject("ADODB.recordset") query = "SELECT * FROM [Formats] " & _ " WHERE " & _ " [Format_Id] = " & formatId rs.Open query, conn strOut = "" do until rs.EOF formatTitle = rs.Fields("Title") rs.MoveNext loop set rs = Server.CreateObject("ADODB.recordset") if (tid="country") then query = "SELECT * FROM [BTBAndBTC] " & _ " WHERE " & _ " [country_Id] = " & uid & _ " AND [Format_Id] = " & formatId elseif (tid="region") then query = "SELECT * FROM [BTBAndBTC] " & _ " WHERE " & _ " [region_Id] = " & uid & _ " AND [Format_Id] = " & formatId end if rs.Open query, conn do until rs.EOF btb = rs.Fields("btb") btc = rs.Fields("btc") rs.MoveNext loop set rs = Server.CreateObject("ADODB.recordset") if (tid="country") then query = " SELECT format(sum(QuantityPerCountry.Quantity), '#,###') AS BTBBTCtotal " & _ " FROM QuantityPerCountry " & _ " WHERE (((QuantityPerCountry.List_Id)=1 Or (QuantityPerCountry.List_Id)=2) " & _ " AND ((QuantityPerCountry.Format_Id)=" & formatid & ") " & _ " AND ((QuantityPerCountry.Country_Id)=" & uid & " )) " elseif (tid="region") then query = " SELECT format(sum(QuantityPerRegion.Quantity), '#,###') as BTBBTCtotal " & _ " FROM QuantityPerRegion " & _ " WHERE (((QuantityPerRegion.List_Id)=1 Or (QuantityPerRegion.List_Id)=2) " & _ " AND ((QuantityPerRegion.Format_Id)= " & formatId & ") AND ((QuantityPerRegion.Region_Id)=" & uid & ")) " end if rs.Open query, conn do until rs.EOF TotalBTBandBTC = rs.Fields("BTBBTCtotal") rs.MoveNext loop fid = Request.QueryString("fid") if (fid = 1) then infoclass = "info2" elseif (fid = 2) then infoclass = "info5" elseif (fid = 3) then infoclass = "info3" end if %>
<% Response.Write(CountryOrRegionTitle) %> <% Response.Write(formatTitle) %>
<%Response.Write(TotalBTBandBTC ) %> BtB <% Response.Write(BtB)%> BtC <% Response.Write(BtC)%>
 
<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "0" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "0" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Masterfiles
" & rs.Fields("Quantity") & "" & rs.Fields("List_Name") & "

<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "97" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "97" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Avid Readers
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "

<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "64" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "64" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Business Decision-Makers
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "

<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "156" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "156" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Esoterics Enthusiasts
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "

<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "118" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "118" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Instant Wealth Seekers
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "
<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "133" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "133" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Luxury Lovers
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "

<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "124" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "124" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Ready Buyers
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "

<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "53" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "53" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Travellers
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "

<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "169" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "169" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Technology Update Watchers
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "

<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "174" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "174" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Healthy Living Aspirants
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "
<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "4" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "4" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Business Connections
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "

<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "36" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "36" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Business Indices
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "

<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "45" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "45" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Eurasia Liaisons
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "

<% set rs = Server.CreateObject("ADODB.recordset") displayname = "" if tid = "country" then query = "SELECT * FROM [vwQuantities] " & _ " WHERE " & _ " [ListParent_Id] = " & "77" & _ " AND [Country_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " elseif tid = "region" then query = "SELECT * FROM [vwQuantitiesPerRegion] " & _ " WHERE " & _ " [ListParent_Id] = " & "77" & _ " AND [Region_Id] = " & uid & _ " AND [Format_Id] = " & formatId & _ " ORDER BY SortOnDropDown " end if rs.Open query, conn strOut = "" do until rs.EOF x=0 strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" strOut = strOut & "" rs.MoveNext loop Response.Write(strOut) %>
  Financial Security Schemers
" & rs.Fields("Quantity") & "" & rs.Fields("List_name") & "

Print this page