error '800a01a8' Object not found
A student ID is input into Request.htm. If the ID is found, the record is returned from an access table called students. When published, the request form accepts the id 101 but then shows this error.
Can anyone see what I'm doing wrong? (The field is text in the mdb.)
Code for Request.htm:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Enter Student Id</title>
<meta name="Microsoft Theme" content="sandston 1011">
<meta name="Microsoft Border" content="tb, default">
</head>
<body>
<form Name = "Request" Action = "results.asp" method = "POST">
<p>Enter Student Id for class registration information:</p>
<table border="0">
<tr><td align = "left" width="99"> <i> Student ID </i>
</td>
<td> <input type ="text" size = 4 name = "StudID"> </td>
</tr>
</table>
<p> <a href="results.asp"> goto results page</a></p>
<p> <input type = "submit" value = "Submit StudID">
<input type = "reset" value = "Reset Form"> </p>
</form>
</body></html>
Code for results.asp:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Student Class Registration Information</title>
<meta name="Microsoft Theme" content="sandston 1011">
<meta name="Microsoft Border" content="tb, default">
</head>
<body>
<center>
<h2> Student Class Registration Information</h2>
<h3> A test of the Web-Based Client/Server Programming with ASP and VBScript</h3><br>
<%
dim myconnection
dim rsTitleList
dim connectstring
dim sqlString
dim requestStudID
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("student.mdb")
set myconnection = Server.CreateObject("ADODB.Connection")
set rsTitleList = Server.CreateObject("ADODB.Recordset")
myconnection.open connectString
requestStudId = Request.Form("StudID")
sqlString = "Select * from [students] where StudentID = '" & requestStudID &"'"
set rsTitleList = myconnection.Execute(sqlString)
if (rsTitleList.bof) and (rsTitleList.eof) then
response.write("Sorry, Student ID Number was not found.")
else
%>
<table align=center Colspa=14 cellpadding=10 border=0 width=300>
<!-begin column header row ->
<tr><td valign = top bgcolor="#800000">
Student ID</td>
<td valign = center bgcolor="#800000">
Last Name</td>
<td valign = center bgcolor="#800000">
First Name</td>
<td valign = center bgcolor="#800000">
Class1</td>
<td valign = center bgcolor="#800000">
Class2</td>
<td valign = center bgcolor="#800000">
Class3</td>
<td valign = center bgcolor="#800000">
Class4</td>
<td valign = center bgcolor="#800000">
Class5</td>
</tr>
<!-Get Data->
<% do while not reTitleList.EOF %>
<tr> <td bgcolor="f7efde" align = center>
<%=rsTitleList("StudentID")%></td>
<td bgcolor="f7efde" align = center>
<%=rsTitleList("Lastname")%></td>
<td bgcolor="f7efde" align = center>
<%=rsTitleList("Firstname")%></td>
<td bgcolor="f7efde" align = center>
<%=rsTitleList("Class1")%></td>
<td bgcolor="f7efde" align = center>
<%=rsTitleList("Class2")%></td>
<td bgcolor="f7efde" align = center>
<%=rsTitleList("Class3")%></td>
<td bgcolor="f7efde" align = center>
<%=rsTitleList("Class4")%></td>
<td bgcolor="f7efde" align = center>
<%=rsTitleList("Class5")%></td>
</tr>
<% rsTitleList.MoveNext %>
<% loop %>
<% End If %>
</table>
</center)
</body>
</html>
|