ASP example 2 from IT Civil Media Server



<% @LANGUAGE = VBScript %>
<% ' Retrieving Information about groups/projects from sem6_project_db 1998
Option Explicit
Response.Expires = 0
Dim objConn, objRS, strQuery
Dim strConnection
Set objConn = Server.CreateObject("ADODB.Connection")
strConnection = "DSN=sem6_project_db;Database=sem6_project_db;"
strConnection = strConnection  & "UID=;PWD=;"
objConn.Open strConnection


      
             
strQuery = "SELECT enavn, fnavn, projgroup.projid, projtype.projname "
strQuery = strQuery & " FROM person, projgroup, groupperson, projtype "
strQuery = strQuery & " WHERE projtype.projid = projgroup.projid "
strQuery = strQuery & " AND groupperson.groupid = projgroup.groupid "
strQuery = strQuery & " AND person.personid = groupperson.personid  "
strQuery = strQuery & " ORDER BY projgroup.groupid ASC, person.enavn ASC, person.fnavn ASC;"

Set objRS = objConn.Execute(strQuery)
%>
<HTML>
<BODY bgcolor="ffffff">
<%Response.Write "<table>"
Response.Write "<tr>"
Response.Write "<td width='10%'>"
Response.Write "</td>"
Response.Write "<td>"
%>



<h2>All participants listed by name, group belonging and project:
</h2><BR><BR>
<%


Response.Write "<table border='1'>"

Response.Write "<tr>"
Response.Write "<td>"
   Response.Write "<B>Second name</B>" 
  Response.Write "</td>" 
   Response.Write "<td>"
   Response.Write "<B>First name</B>"
Response.Write "</td>"
Response.Write "<td>"
   Response.Write "<B>Project id.</B>" 
  Response.Write "</td>" 
   Response.Write "<td>"
   Response.Write "<B>Project name</B>"
Response.Write "</td>"
Response.Write "</tr>"


While Not objRS.EOF
Response.Write "<tr>"

Response.Write "<td>"
   Response.Write objRS("enavn") & "   "
     Response.Write "</td>" 

Response.Write "<td>"
 Response.Write objRS("fnavn") & "   "
   Response.Write "</td>" 

Response.Write "<td>"
Response.Write objRS("projid") & "   "
  Response.Write "</td>" 

Response.Write "<td>"
Response.Write objRS("projname")& "<BR>"
  Response.Write "</td>" 
  
   Response.Write "</tr>"
   
   objRS.MoveNext
Wend
Response.Write "</table>"


objRS.close
objConn.close
Set objRS = Nothing
Set objConn = Nothing
%>
<%
Response.Write "</td>"

Response.Write "<td width='10%'>"
Response.Write "</td>"
Response.Write "</tr>"
Response.Write "</table>"
%>

<br><br><br>
<font size="-1">
Per Christiansson, 17.10.2000
</font>


</BODY> </HTML>