<% dim connection, rs, ps, qs, ss, countx set connection=server.createobject("adodb.connection") connection.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="& Server.MapPath("./databases/membersx.mdb") set ps = connection.execute("SELECT count(memid) AS countx FROM members WHERE url<>'' AND name<>'admin'") randomize() mpick = int(ps("countx") * Rnd())+1 set rs = connection.Execute("SELECT * FROM members WHERE url<>'' AND name<>'admin'") SQL = "SELECT Categories.Category, Count(members.MemId) AS county" &_ " FROM members INNER JOIN (Categories INNER JOIN catlink ON Categories.CatId = catlink.CatId) ON" &_ " members.MemId = catlink.MemId WHERE members.URL<>''" &_ " GROUP BY Categories.Category HAVING Categories.Category='Community Organisations'" set qs = connection.execute(SQL) randomize() apick = int(qs("county") * Rnd())+1 SQS = "SELECT members.*, Categories.Category FROM Categories" &_ " INNER JOIN (members INNER JOIN catlink ON members.MemId = catlink.MemId)" &_ " ON Categories.CatId = catlink.CatId WHERE Categories.Category='Attractions' AND members.url<>''" set ss = connection.Execute(SQS) SQK = "SELECT Categories.Category, Count(members.MemId) AS countt" &_ " FROM members INNER JOIN (Categories INNER JOIN catlink ON Categories.CatId = catlink.CatId) ON" &_ " members.MemId = catlink.MemId WHERE members.URL<>''" &_ " GROUP BY Categories.Category HAVING Categories.Category='Community Organisations'" set ws = connection.execute(SQK) randomize() cpick = int(ws("countt") * Rnd())+1 SQT = "SELECT members.*, Categories.Category FROM Categories" &_ " INNER JOIN (members INNER JOIN catlink ON members.MemId = catlink.MemId)" &_ " ON Categories.CatId = catlink.CatId WHERE Categories.Category='Community Organisations' AND members.url<>''" set cs = connection.Execute(SQT) %> Mount Macedon On Line - Business Tourism Community Events and Attractions Directory online
<% do while not cs.eof %> <% c = c + 1 if c = cpick then %>

<%=cs("name")%>

" target="_blank"> Visit

<%end if%> <% cs.movenext %> <% loop %>

 

 

<% do while not rs.eof %> <% a = a + 1 if a = mpick then %>

<%=rs("name")%>

" target="_blank"> Visit

<%end if%> <% rs.movenext %> <% loop %>
<% do while not ss.eof %> <% b = b + 1 if b = apick then %>

<%=ss("name")%>

" target="_blank"> Visit

<%end if%> <% ss.movenext %> <% loop %>

 

Copyright © Mount MacedonOnline2001-2002
contact credits disclaimer photos