<% Option Explicit if lcase(trim(Request.ServerVariables("HTTP_HOST"))) = "primodirectory.com" then Response.Status = "301 Moved Permanently" Response.AddHeader "Location", "http://www.primodirectory.com/" Response.End end if %> <%response.Charset="utf-8"%> <% dim rst, sSQL Set rst = Server.CreateObject("ADODB.RecordSet") 'strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\mark\My Documents\mywebsites\directory\sites2003.mdb" '## MS Access 2000 strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\hshome\primodirectory\sites2003.mdb" '## MS Access 2000 %> <% dim rstUser, sSQLUser, strConnStringUser Set rstUser = Server.CreateObject("ADODB.RecordSet") 'strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\mark\My Documents\mywebsites\directory\sites2003.mdb" '## MS Access 2000 'response.write(Server.MapPath("users.mdb") & "
") strConnStringUser = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\hshome\primodirectory\users.mdb" '## MS Access 2000 %> <% Dim uChk sSQLUser = "Select * from tbl_users where uname_sha = '" & request.Cookies("primo")("un") & "' and upwd = '" & request.Cookies("primo")("pd") & "'" 'response.write sSQLUser rstUser.open sSQLUser, strConnStringUser,3,3 if not rstUser.EOF and not rstUser.BOF then rstUser.MoveFirst select case rstUser("ugrade") case "all" uChk = "all" case "sub" uChk = "sub" case else uChk = "" end select else ' failed authentication uChk = "" end if rstUser.Close 'response.write "here:" & request.Cookies("primo")("un") & " " & request.Cookies("primo")("pwd") set rstUser = Nothing %> <% 'This include file creates a database connection 'to the SQL pubs database Dim objConn, sConnString Set objConn = Server.CreateObject("ADODB.Connection") Dim strConnString 'We want the MSDataShape provider and no Data Provider sConnString = "Provider=MSDATASHAPE; Data Provider=NONE;" objConn.Open sConnString 'Open the connection 'Create a Recordset Dim objParentRS, objChildRS Set objParentRS = Server.CreateObject("ADODB.Recordset") Set objChildRS = Server.CreateObject("ADODB.Recordset") 'Create our custom data shape (hierarchical Recordset) Dim strSQL strSQL = "SHAPE APPEND " & _ " NEW adInteger AS CatID, " & _ " NEW adVarChar(50) AS CatDesc, " & _ " ((SHAPE APPEND " & _ " NEW adInteger AS SubCatID, " & _ " NEW adVarChar(50) AS CatDesc, " & _ " NEW adInteger AS CatID) " & _ " RELATE CatID TO CatID) AS rsProjects" objParentRS.LockType = 2 objParentRS.Open strSQL, objConn 'Now, we've created our custom hierarchical Recordset... 'Time to populate it! sSQL = "select * from Cat Where CatParent = 0 and RelatedLinkTo = 0 order by [CatDesc]" rst.open sSQL, strConnString,3,3 rst.MoveFirst do objParentRS.AddNew objParentRS("CatID") = rst("CatID") objParentRS("CatDesc") = Trim(rst("CatDesc")) objParentRS.Update rst.MoveNext loop until rst.EOF 'Now we have to add subs for each cat rst.Close sSQL = "select * from Cat Where CatParent <> 0 and RelatedLinkTo = 0 order by CatDesc" rst.open sSQL, strConnString,3,3 Set objChildRS = objParentRS("rsProjects").Value rst.MoveFirst do objChildRS.AddNew objChildRS("SubCatID") = rst("CatID") objChildRS("CatDesc") = Trim(rst("CatDesc")) objChildRS("CatID") = rst("CatParent") objChildRS.Update rst.MoveNext loop until rst.EOF %> Primo Directory <% if uChk <> "" then %> admin <% end if %>


home about primo contact primo privacy

primo web directory

  
<% rst.Close i = 0 sSQL = "select * from Sites where Active = True and sDeleted = False order by SiteID Desc" rst.open sSQL, strConnString,3,3 if not rst.BOF and not rst.EOF then do i = i + 1 %> <% rst.MoveNext loop until i = 10 or rst.EOF end if %>

Recently Listed

"><%=rst("SiteTitle")%>



<% i = 0 rst.Close sSQL = "select * from cat order by iVisited desc;" rst.open sSQL, strConnString,3,3 if not rst.BOF and not rst.EOF then do i = i + 1 %> <% rst.MoveNext loop until i = 10 or rst.Eof end if %>

Popular Categories

"><%=rst("CatDesc")%>
<% 'Ok, now let's list out the employees and their associated 'projects. This will require two Do ... Loops dim i i = 0 'Iterate through the Recordset objParentRS.MoveFirst Do While Not objParentRS.EOF i = i + 1 Response.Write("" & vbCR) objParentRS.MoveNext ' make it a 3 column table if i = 3 then response.write "" & vbCR & "" & vbCR i = 0 end if Loop ' tidy the table if i <> 3 then do response.write "" i = i + 1 loop until i = 3 end if %>

Browse Categories

how to submit a site

" & objParentRS("CatDesc") & "

") 'Now Set the Child recordset to rsTitles Set objChildRS = objParentRS("rsProjects").Value 'Loop through the Child recordset If objChildRS.EOF Then Response.Write(" ") dim j j = 0 objChildRS.Move 1 Do While Not objChildRS.EOF and j < 5 if j = 4 then Response.Write("" & objChildRS("CatDesc") & "") else Response.Write("" & objChildRS("CatDesc") & ", ") end if objChildRS.Move 2 j = j + 1 Loop Response.Write("
 
 
<% 'Clean up... objParentRS.Close Set objParentRS = Nothing Set objChildRS = Nothing objConn.Close Set objConn = Nothing rst.Close Set rst = Nothing %>