<% 'connection objects Set conn = CreateObject("ADODB.Connection") Set rs = CreateObject("ADODB.Recordset") conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("../data/directory.mdb") dim sql dim category dim header dim body dim i 'display total sql = "" & _ "SELECT Count(ID) AS [Count] " & _ "FROM Links " & _ "WHERE Active=true" rs.open sql, conn, 1, 2, 1 header = "

Weight Loss Directory (" & rs("Count") & ")

" rs.close 'display cats sql = "" & _ "SELECT Categories.ID, Categories.Description, Count(Links.ID) AS [Count] " & _ "FROM Categories INNER JOIN Links ON Categories.ID = Links.CategoryID " & _ "WHERE Links.Active=true " & _ "GROUP BY Categories.Description, Categories.ID" rs.open sql, conn, 1, 2, 1 header = header & "" i = 0 while not rs.eof header = header & "" if i = 3 then header = header & "" i = 0 else i = i + 1 end if rs.movenext wend header = header & "
  • " & rs("Description") & " (" & rs("Count") & ")
  • " rs.close 'get category if Request("id") & "x" <> "x" then category = Request("id") else category = 1 'sql = "Select * From Categories" 'rs.open sql, conn, 1, 2, 1 'category = rs("ID") 'rs.close end if body = "" 'pop list sql = "Select * From Categories Where ID = " & category & ";" rs.open sql, conn, 1, 2, 1 body = body & "

    " & rs("Description") & "

    " rs.close sql = "Select * From Links Where CategoryID = " & category & " And Active = true Order By Title;" rs.open sql, conn, 1, 2, 1 while not rs.eof body = body & "

    " & rs("Title") & " - " & rs("Description") & "

    " rs.movenext wend rs.close %>
    Home Products Free E-zine Press Room Contact Us About Us
    <%= header %>
    <%= body %>