<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsWebContent 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query for the database
Dim lngRecordNo
'We need to grab the parameter out of the query string collection.
'If parameter doesn't exist display notice and stop processing.
If(Request.QueryString("id") <> "")Then
lngRecordNo = CInt(Request.QueryString("id"))
Else
Response.Write("Error: Teacher Id Required")
Response.End
End If
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("ParentTeacherConf.mdb")
'Set an active connection to the Connection object using DSN connection
'adoCon.Open "DSN=cms"
'Create an ADO recordset object
Set rsWebContent = Server.CreateObject("ADODB.Recordset")
'We need to search by Item_Id NOT teachername since that is the parameter you are passing.
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblParentTeacher.TimeSlot, tblParentTeacher.Item_ID FROM tblParentTeacher, tblTeachers WHERE tblTeachers.Item_Id = " & lngRecordNo &" ORDER BY tblParentTeacher.TimeSlot ASC;"
'Open the recordset with the SQL query
rsWebContent.Open strSQL, adoCon
'Loop through the recordset
Do While not rsWebContent.EOF
'Write the HTML to display the current record in the recordset
Response.Write ("
")
Response.Write ("")
Response.Write (rsWebContent("TimeSlot"))
Response.Write ("")
Response.Write ("")
Response.Write ("
")
'Move to the next record in the recordset
rsWebContent.MoveNext
Loop
'Reset server objects
rsWebContent.Close
Set rsWebContent = Nothing
Set adoCon = Nothing
%>