Click to See Complete Forum and Search --> : Why doesn't my search results page work


stevepugh
08-03-2005, 09:37 AM
Firstly, I a REAL Newbie to ASP.

I have been us ing Dreamweaver MX 2004 to set up a facility to search an MS Access 2000 database. I followed the DW help instructions on how to do this.

A DSN connection was made and tested OK.
Under Bindings tab a recordset was made connecting to the database table. A test was run on the SQL statement which was sucessful.

When I then submit a search on the search page the results page is not displayed and I get the following error:

ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/results.asp, line 36

The code from my results page is a follows:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/iimiaEmployees.asp" -->
<%
Dim rsIimiaEmployees__MMColParam
rsIimiaEmployees__MMColParam = "1"
If (Application("Surname") <> "") Then
rsIimiaEmployees__MMColParam = Application("Surname")
End If
%>
<%
Dim rsIimiaEmployees
Dim rsIimiaEmployees_numRows

Set rsIimiaEmployees = Server.CreateObject("ADODB.Recordset")
rsIimiaEmployees.ActiveConnection = MM_iimiaEmployees_STRING
rsIimiaEmployees.Source = "SELECT Employee_id, First_Name, Surname, Company, Department, Job_Title, Email, Telephone_Number, Extension, Location FROM Employee_Details WHERE Surname = '" + Replace(rsIimiaEmployees__MMColParam, "'", "''") + "' ORDER BY Surname ASC"
rsIimiaEmployees.CursorType = 0
rsIimiaEmployees.CursorLocation = 2
rsIimiaEmployees.LockType = 1
rsIimiaEmployees.Open()

rsIimiaEmployees_numRows = 0
%>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Search Results</title>
<link href="test.css" rel="stylesheet" type="text/css" />
</head>

<body>
<%=(rsIimiaEmployees.Fields.Item("First_Name").Value)%><br />
<%=(rsIimiaEmployees.Fields.Item("Surname").Value)%><br />
<%=(rsIimiaEmployees.Fields.Item("Company").Value)%><br />
<%=(rsIimiaEmployees.Fields.Item("Department").Value)%><br />
<%=(rsIimiaEmployees.Fields.Item("Job_Title").Value)%><br />
<%=(rsIimiaEmployees.Fields.Item("Email").Value)%><br />
<%=(rsIimiaEmployees.Fields.Item("Telephone_Number").Value)%><br />
<%=(rsIimiaEmployees.Fields.Item("Extension").Value)%><br />
<%=(rsIimiaEmployees.Fields.Item("Location").Value)%><br />
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

</body>
</html>
<%
rsIimiaEmployees.Close()
Set rsIimiaEmployees = Nothing
%>


Can anyone, please help me figure out why the search does not work in as simple terms as possible.

Thanks,

Steve

stevepugh
08-03-2005, 11:26 AM
No Worries. I've sussed it.

Thanks to the 4 of you who viewed my thread though.

Bullschmidt
08-09-2005, 07:46 PM
Way to go and just for reference here's a related link:

Why do I get 'BOF or EOF' errors?
http://www.aspfaq.com/show.asp?id=2246