Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SEARCH RESULT PAGE ERROR

Status
Not open for further replies.

RamDje

Programmer
Apr 3, 2003
23
US
Hey all,

I am making a search function for a website I am designing. I have followed the instructions per the tutorial in Dreamweaver MX but am still receiving an error message on the results page. Here are the details:

1.) Search Form Details:
...form action="search_results.asp" method="get" name="fNAME" id="fNAME">
<input type=&quot;text&quot; name=&quot;textfield&quot;>
<input name=&quot;search&quot; type=&quot;submit&quot; id=&quot;search&quot; value=&quot;search&quot;>
...

2.) Error Message: ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/car/TMPc72c6cxxjk.asp, line 29

Line 29 Says: ...td bgcolor=&quot;#000000&quot;> <font color=&quot;#FFFFFF&quot; size=&quot;1&quot; face=&quot;Verdana&quot;><%=(rsSPO.Fields.Item(&quot;fNAME&quot;).Value)%></font>...

3.) Search Results Page Detail

FORM/RECORDSET INFO:
<!--#include file=&quot;Connections/SPO.asp&quot; -->
<%
var rsSPO__MMColParam = &quot;1&quot;;
if (String(Request.Form(&quot;fNAME&quot;)) != &quot;undefined&quot; &&
String(Request.Form(&quot;fNAME&quot;)) != &quot;&quot;) {
rsSPO__MMColParam = String(Request.Form(&quot;fNAME&quot;));
}
%>
<%
var rsSPO = Server.CreateObject(&quot;ADODB.Recordset&quot;);
rsSPO.ActiveConnection = MM_SPO_STRING;
rsSPO.Source = &quot;SELECT * FROM SPO_DATABASE WHERE fNAME = '&quot;+ rsSPO__MMColParam.replace(/'/g, &quot;''&quot;) + &quot;' ORDER BY fNAME ASC&quot;;
rsSPO.CursorType = 0;
rsSPO.CursorLocation = 2;
rsSPO.LockType = 1;
rsSPO.Open();
var rsSPO_numRows = 0;
%>

CONNECTION INFO:
Name: rsSPO

Connection: SPO

SQL: SELECT *
FROM SPO_DATABASE
WHERE fNAME = 'MMColParam'
ORDER BY fNAME ASC

VARIABLES: MMColParam 1 Request.Form(&quot;fNAME&quot;)


I know the record exists. The search works during the insertion of the recordset using the test button, just not on the results page. Any help would be great.

Thanks,
Rami RRD
 
As the error states, either EOF or BOF is true, i.e. you have not found a record.

If your search returns no result, you have to allow for that. Steve Davis
hey.you@hahaha.com.au

Me? I can't even spell ASP!
 
Thanks Steve........I have tried desparately to hardcode the values into the string as you said but believe I made things worse.

So I started from scratch. I still cant's seem to get past that damned error message...EOF/BOF 800a0bcd.

As you can tell I am learning this stuff. After many attempts and re-attempts to get this simple search function completed, I am at my wits end. I even created a database with a table that only had three names....all Michael.....just to se if there was a problem with the first database I was using. Same error message.

Is there a resource on the web, or someone in these forums that has had the same problem? Any help would be great.

Forgive my rambling as I cannot understand why something so simple is giving me a daily migraine.....lol.

-Rami RRD
 
So, have you tried stripping it back to

&quot;SELECT * FROM SPO_DATABASE WHERE fNAME = 'Michael';&quot;

Grab a really basic recordset, see if that works. Then build up from there.

Alternatively, comment out the .open statement and the write teh SQL string to the page so you can see what it is actually trying to do

Also, if you are searching, you might want to give it a bit of lattitude in case someone searches for &quot;Mich&quot;, it will return Mich, Michelle, Michael etc using this:

&quot;SELECT * FROM SPO_DATABASE WHERE fNAME LIKE 'Mich';&quot;

WHOA!!! Just noticed that the end of the SQL string is &quot;' ORDER BY fNAME ASC&quot;; before you do anything else, give it a go with the semicolon INSIDE the quotes i.e. &quot;' ORDER BY fNAME ASC;&quot;

But I would expect that to break the page completely rather than return no result, whatever, it is wrong.

I have a feeling that is your problem (fingers crossed)

Steve Davis
hey.you@hahaha.com.au

Me? I can't even spell ASP!
 
Of course, you knew I meant to put:

Also, if you are searching, you might want to give it a bit of lattitude in case someone searches for &quot;Mich&quot;, it will return Mich, Michelle, Michael etc using this:

&quot;SELECT * FROM SPO_DATABASE WHERE fNAME LIKE '%Mich%';&quot;

didn't you? :eek:)
Steve Davis
hey.you@hahaha.com.au

Me? I can't even spell ASP!
 
Thanks Steve,

I will try that right now and see if it helps. I am sure there is a way to write the code directly onto the Code View without having to use the DWMX dropdowns and such. I just don't know how to do that yet. I am thinking that might be a better way to do this. What's your opinion?

The actual database that the search function will be used on will be for a Physicians Database (400 Physicians) on a site. They should be able to search for First Name, Last Name, Specialty, City, and ZIP. So, if I understand correctly, I will have to make the search function to search multiple columns/fields in the one database. That is the result I am going for.

First off though, I have to figure out the simple search function before I can move on to multiple search pramaters.

By the way...I do appreciate all your assistance.....Thanks.
-Rami RRD
 
Wrting code? I used to do it almost all by hand, even in DW, but with MX, I keep discovering ways the programme will do it for me.

Most often I have to tweak it a bit as generally what I am doing is not &quot;out of the box&quot; stuff, but to just grab a recordset, insert or update I let DW do the work.

The problem with letting DW do it all is that you can get a bit rusty on coding, but if you are just making one app...what the hell.

A good thing to get your hands on is the VBScript reference file. Search Google for &quot;vbscript language reference&quot; Steve Davis
hey.you@hahaha.com.au

Me? I can't even spell ASP!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top