%@ Language=VBScript %>
<% Response.Buffer = True %>
Student Listing
<%
Dim objRS,objConn
Set objRS = Server.CreateObject("ADODB.Recordset")
set objConn = Server.CreateObject("ADODB.Connection")
// txtSQL = "Select * from tblStudentWebs "
txtSQL = "SELECT tblStudentwebs.recordid, tblStudentWebs.Class, tblStudentWebs.FirstName, tblStudentWebs.LastName, tblStudentWebs.WebSiteURL " & _
" FROM tblStudentWebs " & _
" WHERE (tblStudentwebs.term Is Not Null) " & _
" ORDER BY tblStudentWebs.Class, tblStudentWebs.LastName; "
// select Students from specific course, 'DIS342-01 12:30pm'
// txtSQL = "SELECT RecordID, [FirstName] & ' ' & [LastName] AS Name, tblStudentWebs.WebSiteURL " & _
// "FROM tblStudentWebs " & _
// "WHERE (((tblStudentWebs.Class)='DIS342-01 12:30pm')) " & _
// "ORDER BY tblStudentWebs.LastName; "
// txtSQL = "SELECT [firstname] & ' ' & [lastname] AS Name, 'http://studentwebs.winona.edu/' & [websiteurl] AS url, 'mailto:' & [emailaddress] AS email, Last(tblStudentWebs.TimeTrack) AS LastOfTimeTrack, tblStudentWebs.Class " & _
// "FROM tblStudentWebs " & _
// "GROUP BY [firstname] & ' ' & [lastname], 'http://studentwebs.winona.edu/' & [websiteurl] , 'mailto:' & [emailaddress], tblStudentWebs.Class, tblStudentWebs.LastName " & _
// "HAVING (((tblStudentWebs.Class)='dis312-02 9am')) " & _
// "ORDER BY tblStudentWebs.LastName; "
// *** MUST MODIFY FOR YOUR SPECIFIC DATABASE INSTALLATION ***
objConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("/ppaulson/studenthw") & "\" & "StudentWeburls.mdb"
set objRS = objConn.Execute(txtSQL,intRecordsAffected)
if intRecordsAffected < 0 Then
objRS.MoveFirst %>
Fall 2003 Courses
>
<% For each objField in objRS.Fields %>
<%=objField.Name %> |
<% Next %>
<% Do while Not objRS.EOF %>
<% For Each objField in objRS.Fields %>
<% If IsNull(objField) Then
Response.Write(" ")
else
Response.Write("" & objField.value & "")
End If
%>
|
<% Next
objRS.MoveNext %>
<% Loop %>
<% objRS.close
set objRS = Nothing
end if
// Response.Write("" & intRecordsAffected & " records affected!")
// Response.Write("
Return to SQL Entry Form")
%>