<% function getFilePath() dim lsPath, arPath lsPath = request.ServerVariables("SCRIPT_NAME") arPath = split(lsPath, "/") arPath(UBound(arPath,1)) = "" getFilePath = Join(arPath, "/") end function function dbLogin(strDBPath) dim strConnect, adoConnection strConnect = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(strDBPath) set adoConnection = Server.CreateObject("ADODB.Connection") adoConnection.Open strConnect dbLogin = adoConnection end function dim strSQL, strLoc, adoCon, rsSQL, rsCourse, rsSched, n strLoc = getFilePath() strLoc = replace(strLoc, "/std_corner", "") strLoc = strLoc & "Database/db.mdb" adoCon = dbLogin(strLoc) strSQL = "select * from nh_course_section order by section_order asc;" set rsSQL = Server.CreateObject("ADODB.Recordset") rsSQL.Open strSQL, adoCon do while not rsSQL.EOF %>">

<% if trim(rsSQL("title")) = "" then response.Write(trim(rsSQL("title_c"))) else response.Write(trim(rsSQL("title"))) end if %>

<% strSQL = "select * from nh_course where section='" & rsSQL("section") & "' order by course_order asc;" set rsCourse = Server.CreateObject("ADODB.Recordset") rsCourse.Open strSQL, adoCon %> <% do while not rsCourse.EOF %> <% rsCourse.MoveNext loop %>
<% for i = 1 to rsCourse("level") - 1 response.Write("      ") next if trim(rsCourse("title")) = "" then response.Write(trim(rsCourse("title_c"))) else response.Write(trim(rsCourse("title"))) end if %> <% strSQL = "select * from nh_course_link where course_id=" & rsCourse("course_id") & " order by link_order asc;" set rsSched = Server.CreateObject("ADODB.Recordset") rsSched.Open strSQL, adoCon if rsSched.EOF then response.Write(" ") else n = 0 do while not rsSched.EOF if n > 0 then response.Write("
") end if %>" target="_blank"><% if rsSched("doc_type") = "pdf" then %><% elseif rsSched("doc_type") = "xls" then %><% elseif rsSched("doc_type") = "doc" then %><% elseif rsSched("doc_type") = "html" then %><% end if if trim(rsSched("link_title")) = "" then response.Write(trim(rsSched("link_title_c"))) else response.Write(trim(rsSched("link_title"))) end if %> <% if trim(rsSched("special_word")) = "" then response.Write(trim(rsSched("special_word_c"))) else response.Write(trim(rsSched("special_word"))) end if %> <% n = n + 1 rsSched.MoveNext loop end if %>
<% rsSQL.MoveNext loop %>