Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_ado_rds thread: Help with error '800a0cc1'


Message #1 by aj@h... on Sat, 18 Aug 2001 17:31:49
Hi im getting an error which has baffled me slightly...



ADODB.Fields error '800a0cc1' 

ADO could not find the object in the collection corresponding to the name 

or ordinal reference requested by the application. 



/ATWISP/hotels/hotelsresults.asp, line 185 



Firstly I don't know what it means, I have re-checked the database (access 

2000) and all fields are present. I was advised that I had used a reserved 

word used by access?? but having changed the word I still get the same 

error. The code is as follows: I have marked line 185... If anybody can 

shed a little light on this I would be grateful.



<%@ Language=VBScript %>



<%

set cnCambEstate = Server.CreateObject("ADODB.Connection")

cnCambEstate.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & 

Server.MapPath("../db/atwportal.mdb") & ";"

%>



<html><head>

<!--#include file="../Stats/incstats.asp"--> 

<%

StatLog

%>

<meta http-equiv=refresh content=300>



</head>

<!--#include file="hotelmenu.asp"-->

	

<table border=0 cellpadding=0 cellspacing=0 width=80%>

<tr><td>



<CENTER>

<table border=0 height="100%" align="center">

	<tr>

		<td>

		<%

		Dim varPrice

		varPrice = request.form("Price")

		

		'Check routine for any characters that shouldn't be there!

		If IsNumeric(varPrice) = False then

			Call Procedure_Err

		End If

		If Instr(varPrice, "£") > 0 then

			Call Procedure_Err

		End If

		If Instr(varPrice, ".") > 0 then

			Call Procedure_Err

		End If

		If Instr(varPrice, ",") > 0 then

			Call Procedure_Err

		End If

		

		'Procedure called on error 	

		Sub Procedure_Err

		%>

		<br><br><br>

		<h2><i>Incorrect Entry</i></h2>

			<font color="Red">An incorrect entry has been 

made.</font><br>

			<b><I>This usually occurs if the "Price" field has 

been left blank or data entered incorrectly</I></b><br>

			Please return to the previous page and re-enter 

the data.<br>

			NOTE: Only numbers (without decimal points)should 

be entered in the "Price" field.<BR> DO NOT enter any other characters 

(e.g. "£ , - ." etc)<br>

			Click the search button to return to the previous 

page.

			<p>

				<form method="post" 

action="hotelssearch.asp?area=<%=request.querystring("Area")%>">

					<input type="Submit" 

value="search">

				 </form>

			</p>

			<br><br>	 

		</td>

		</tr>

		</table>

		<br><br><br>

		<br><br><br>

		<br><br><br>

		<br><br><br>

		<br><br><br>

		<br><br><br>

		<!--#include file="footer.asp"-->

			

		<%

		Response.end

		End Sub



'--- Begin Search Formatting ---



dim Searches()

redim Searches(0)

Searches(0) = "1=1"



if Request("Price") = "" Then

varSQL = ""

Else

varSQL = "WHERE estate.Price <= " & Request("Price")

End if



if Request("Type") <> "" Then

if varSQL <> "" Then

varSQL = varSQL & " AND estate.Type = '" & Request("Type") & "'"

else

varSQL = "WHERE estate.Type = '" & Request("Type") & "'"

end if

end if



if Request("Bed") <> "" Then

if varSQL <> "" Then

varSQL = varSQL & " AND  estate.Bed = '" & Request("Bed") & "'"

else

varSQL = "WHERE estate.Bed = '" & Request("Bed") & "'"

End if

end if



'response.write varSQL & "<br>"



'--- End search formatting. ---



cPageSize = 2

vSearchString = join(Searches," AND ")

if Request.QueryString("Agent") <> "" then vSearchString = "Estate.Agent=" 

+ Request.QueryString("Agent")

vSQL = "SELECT Estate.*, estate.ID, estate.Number, estate.Street, 

estate.Area, estate.PostalCode, estate.description1, estate.description2, 

estate.description3, estate.Price, estate.Type, estate.Bed, estate.Bed2, 

estate.Contact, estate.Tel, estate.Fax, estate.Email, estate.Website, 

estate.Thumbs, estate.Image, estate.County, Agents.Email, Agents.AgentName 

FROM Estate INNER JOIN Agents ON Estate.Agent = Agents.ID " & varSQL

if Request.QueryString("page") = "" then vCurrentPage = 1 else 

vCurrentPage = Request.QueryString("page")



Set rsEstate = Server.CreateObject("ADODB.Recordset")

rsEstate.CursorLocation = 3 'Client

rsEstate.CursorType = 3 'adOpenStatic

rsEstate.CacheSize = cPageSize

rsEstate.Open vSQL, cnCambEstate

rsEstate.PageSize = cPageSize



if rsEstate.EOF then

%>

<BR><BR>

<center>

<span class=aj>No records were found that matched your query in <B><%

=request.querystring("Area")%></B>.<BR>Click<a href="hotelssearch.asp?

area=<%=request.querystring("Area")%>"> <b>[here]</b></a> to try again</h5>

<table background="images/blackpool.jpg" alt="" align=center border=0 

width=550 height=391 cellpadding=0 cellspacing=0>

<tr><td>

</td></tr>

</table>

<%

else

rsEstate.AbsolutePage = vCurrentPage

if session("debug") <> "" then Response.Write "<div 

class=debug><p><b>Pagecount:</b> <i>" & rsEstate.PageCount 

& "</i></p></div>"

if session("debug") <> "" then Response.Write "<div 

class=debug><p><b>Current page:</b> <i>" & vCurrentPage & "</i></p></div>"

vFrom = ((vCurrentPage - 1) * cPageSize) + 1

vTo = vCurrentPage * cPageSize

if vTo > rsEstate.RecordCount then vTo = rsEstate.RecordCount

%>

<BR><BR>

<center>

<h5>Found <%=rsEstate.RecordCount%> matching records for hotels in <font 

color="#000080"><b>"<%=request.querystring("Area")%>"</b></font> 

<br>  Displaying records <%=vFrom%> to <%=vTo%></h5>

<DIV align="left"><form method="post" action="hotelssearch.asp?area=<%

=request.querystring("Area")%>">

<input type="Submit" value="Search Again">

</form>

</DIV>

<div align="center">

<%

'-- Start Page Navigation --

if rsEstate.RecordCount > cPageSize then

	if vCurrentPage > 1 then

	%>

	<a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page=" 

& vCurrentPage,"") & "&page=" & vCurrentPage - 1%>">[<< Prev]</a> |

	<%

	else

	%>

	Prev |

	<%

	end if

	for i = 1 to rsEstate.PageCount

		vCurrentPage = vCurrentPage + 0 'Convert to Integer

		if i = vCurrentPage then

			Response.Write "<b>" & i & "</b> | "

		else

	%>

	<a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page=" 

& vCurrentPage,"") & "&page=" & i%>"><%=i%></a> |

	<%

		end if

	next

	if vCurrentPage < rsEstate.PageCount then

	%>

	<a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page=" 

& vCurrentPage,"") & "&page=" & vCurrentPage + 1%>">[Next >>]</a>

	<%

	else

	%>

	Next

	<%

	end if

end if

'-- End Page Navigation --

%>

</div>

<hr width=400 align="center">

<div align="center">

<table border=0 cellpadding=5 cellspacing=0 width=80%>

<%

for i = 1 to rsEstate.PageSize

vLocation = rsEstate("Number") ????????????(line 185)???????????????????

if rsEstate("number") <> "" then vLocation = vLocation & ", "

vLocation = vLocation & rsEstate("Street")

if rsEstate("street") <> "" then vLocation = vLocation & ", "

vLocation = vLocation & rsEstate("Area")

if rsEstate("Area") <> "" then vLocation = vLocation & ", "

vLocation = vLocation & rsEstate("County")

if rsEstate("County") <> "" then vLocation = vLocation & ", "

vLocation = vLocation & rsEstate("PostalCode")

if rsEstate("PostalCode") <> "" then vLocation = vLocation & ". "

description1 = rsEstate("description1")

if rsEstate("description1") <> "" then description1 = description1 & " "

description2 = rsEstate("description2")

if rsEstate("description2") <> "" then description2 = description2 & " "

description3 = rsEstate("description3")

if rsEstate("description3") <> "" then description3 = description3 & " "

Price = rsEstate("Price")

if rsEstate("Price") <> "" then Price = Price & " "

'Type = rsEstate("Type")

'if rsEstate("Type") <> "" then Type = Type & " "

Bed = rsEstate("Bed")

if rsEstate("Bed") <> "" then Bed = Bed & " "

Bed = rsEstate("Bed2")

if rsEstate("Bed2") <> "" then Bed2 = Bed2 & " "

Contact = rsEstate("Contact")

if rsEstate("Contact") <> "" then Contact = Contact & " "

Tel = rsEstate("Tel")

if rsEstate("Tel") <> "" then Tel = Tel & " "

Fax = rsEstate("Fax")

if rsEstate("Fax") <> "" then Fax = Fax & " "

Email = rsEstate("Email")

if rsEstate("Email") <> "" then Email = Email & " "

Website = rsEstate("Website")

if rsEstate("Website") <> "" then Website = Website & " "

ID = rsEstate("ID")

if rsEstate("ID") <> "" then ID = ID & " "

%>

	<tr>

		<td valign="top" width=460>

			<font size="+1"><b><%=rsEstate("AgentName")%

></b></font><br><br>

					<b><%=vLocation%></b>

					<p align="justify">

					<%=rsEstate("description1")%> 

					<%=rsEstate("description2")%> 

					<%=rsEstate("description3")%>

		</td>

		<script language=JavaScript>

<!--

function OpenWindow(vFilename){

var vWindow;

vWindow = window.open(vFilename, vFilename.substring(1,5),'toolbar=no, 

location=no, directories=no, status=no, menubar=no, scrollbars=no, 

resizable=no, width=700 height=525 left=0,top=0');

}

//-->

</script>

		<td valign="top" align="center" height="90" 

align="left"><font size="1"><br>(click here for more details)</font><BR><a 

href="javascript:OpenWindow('hotelresult.asp?ref=<%=rsEstate("ID")%

>&Area=<%=request.querystring("Area")%>')"><img src="thumbimages/<%

=rsEstate("Thumbs")%>" alt="<%=rsEstate("AgentName")%>" border=0 

hspace=5></A></td>	

		 

</tr>                                                                      

 

								<tr><td><p 

align="left"><BR>

					<b>Price Per Room:</b> £<%=rsEstate

("Price")%>     <b>Star Rating:</b> <%=rsEstate("type")%> Star  

   <b> Hotel Size:</b> <%=rsEstate("bed2")%> Bedrooms<BR>

					<b>Contact:</b><%=rsEstate

("Contact")%>   <b>Tel:</b> <%=rsEstate("Tel")%>  

 <b>Fax:</b> <%=rsEstate("Fax")%>   <BR><b>Email:</b> <a 

href="mailto:<%=rsEstate("Email")%>"><%=rsEstate("Email")%></a>

		          <BR><b>Web Site:</b> <a href="<%=rsEstate

("Website")%>" TARGET="BLANK"><%=rsEstate("Website")%></a>		

			                                            

					</td>

		</tr><tr>

		<td height=15> 

		</td></tr>

		</table>



<%

	rsEstate.MoveNext

%>

<hr width=400 align="center">

<table border=0 cellpadding=5 cellspacing=0 width=80%>

	<tr>

		<td colspan=3 align=center>

			

		</td>

	</tr>

<%

	if rsEstate.EOF then exit for

next

%>

<div align="center">

<%

'-- Start Page Navigation --

if rsEstate.RecordCount > cPageSize then

	if vCurrentPage > 1 then

	%>

	<a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page=" 

& vCurrentPage,"") & "&page=" & vCurrentPage - 1%>">Prev</a> |

	<%

	else

	%>

	Prev |

	<%

	end if

	for i = 1 to rsEstate.PageCount

		vCurrentPage = vCurrentPage + 0 'Convert to Integer

		if i = vCurrentPage then

			Response.Write "<b>" & i & "</b> | "

		else

	%>

	<a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page=" 

& vCurrentPage,"") & "&page=" & i%>"><%=i%></a> |

	<%

		end if

	next

	if vCurrentPage < rsEstate.PageCount then

	%>

	<a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page=" 

& vCurrentPage,"") & "&page=" & vCurrentPage + 1%>">Next</a>

	<%

	else

	%>

	Next

	<%

	end if

end if

'-- End Page Navigation --

rsEstate.Close

set rsEstates = nothing

%>

<p>

<a href="#top">Back to the top</A>

</div>

<%

end if

%>

<BR>

</td></tr>

</table>

<!--#include file="footer.asp"-->

Message #2 by "Ken Wilson" <kensan@n...> on Mon, 20 Aug 2001 13:24:49 +0100
Hi AJ



I had a similar situation a while back with an Access field I'd called

Password, which gave me the same kind of problem, I renamed it thePassword

and that fixed it.  I'm not sure that Password is actually an Access

reserved word - I may be wrong - yet it still caused this problem.



You say that you've renamed the field but it's still causing the same error,

I'm afraid I have no explanation for this. Perhaps if you renamed it to

something that doesn't resemble in the slightest a keyword - sorry I know

it's not very scientific but sometimes these things work.



Also have you tried accessing the field by its ordinal number in the table?

I know this isn't the best way to go about it but at least you'd know that

the field was being accessed by your code.



Goodluck



Ken



----- Original Message -----

From: <aj@h...>

To: "ASP_ADO_RDS" <asp_ado_rds@p...>

Sent: Monday, August 20, 2001 11:01 AM

Subject: [asp_ado_rds] Help with error '800a0cc1'





> Hi im getting an error which has baffled me slightly...

>

> ADODB.Fields error '800a0cc1'

> ADO could not find the object in the collection corresponding to the name

> or ordinal reference requested by the application.

>

> /ATWISP/hotels/hotelsresults.asp, line 185

>

> Firstly I don't know what it means, I have re-checked the database (access

> 2000) and all fields are present. I was advised that I had used a reserved

> word used by access?? but having changed the word I still get the same

> error. The code is as follows: I have marked line 185... If anybody can

> shed a little light on this I would be grateful.

>

> <%@ Language=VBScript %>

>

> <%

> set cnCambEstate = Server.CreateObject("ADODB.Connection")

> cnCambEstate.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &

> Server.MapPath("../db/atwportal.mdb") & ";"

> %>

>

> <html><head>

> <!--#include file="../Stats/incstats.asp"-->

> <%

> StatLog

> %>

> <meta http-equiv=refresh content=300>

>

> </head>

> <!--#include file="hotelmenu.asp"-->

>

> <table border=0 cellpadding=0 cellspacing=0 width=80%>

> <tr><td>

>

> <CENTER>

> <table border=0 height="100%" align="center">

> <tr>

> <td>

> <%

> Dim varPrice

> varPrice = request.form("Price")

>

> 'Check routine for any characters that shouldn't be there!

> If IsNumeric(varPrice) = False then

> Call Procedure_Err

> End If

> If Instr(varPrice, "£") > 0 then

> Call Procedure_Err

> End If

> If Instr(varPrice, ".") > 0 then

> Call Procedure_Err

> End If

> If Instr(varPrice, ",") > 0 then

> Call Procedure_Err

> End If

>

> 'Procedure called on error

> Sub Procedure_Err

> %>

> <br><br><br>

> <h2><i>Incorrect Entry</i></h2>

> <font color="Red">An incorrect entry has been

> made.</font><br>

> <b><I>This usually occurs if the "Price" field has

> been left blank or data entered incorrectly</I></b><br>

> Please return to the previous page and re-enter

> the data.<br>

> NOTE: Only numbers (without decimal points)should

> be entered in the "Price" field.<BR> DO NOT enter any other characters

> (e.g. "£ , - ." etc)<br>

> Click the search button to return to the previous

> page.

> <p>

> <form method="post"

> action="hotelssearch.asp?area=<%=request.querystring("Area")%>">

> <input type="Submit"

> value="search">

> </form>

> </p>

> <br><br>

> </td>

> </tr>

> </table>

> <br><br><br>

> <br><br><br>

> <br><br><br>

> <br><br><br>

> <br><br><br>

> <br><br><br>

> <!--#include file="footer.asp"-->

>

> <%

> Response.end

> End Sub

>

> '--- Begin Search Formatting ---

>

> dim Searches()

> redim Searches(0)

> Searches(0) = "1=1"

>

> if Request("Price") = "" Then

> varSQL = ""

> Else

> varSQL = "WHERE estate.Price <= " & Request("Price")

> End if

>

> if Request("Type") <> "" Then

> if varSQL <> "" Then

> varSQL = varSQL & " AND estate.Type = '" & Request("Type") & "'"

> else

> varSQL = "WHERE estate.Type = '" & Request("Type") & "'"

> end if

> end if

>

> if Request("Bed") <> "" Then

> if varSQL <> "" Then

> varSQL = varSQL & " AND  estate.Bed = '" & Request("Bed") & "'"

> else

> varSQL = "WHERE estate.Bed = '" & Request("Bed") & "'"

> End if

> end if

>

> 'response.write varSQL & "<br>"

>

> '--- End search formatting. ---

>

> cPageSize = 2

> vSearchString = join(Searches," AND ")

> if Request.QueryString("Agent") <> "" then vSearchString = "Estate.Agent="

> + Request.QueryString("Agent")

> vSQL = "SELECT Estate.*, estate.ID, estate.Number, estate.Street,

> estate.Area, estate.PostalCode, estate.description1, estate.description2,

> estate.description3, estate.Price, estate.Type, estate.Bed, estate.Bed2,

> estate.Contact, estate.Tel, estate.Fax, estate.Email, estate.Website,

> estate.Thumbs, estate.Image, estate.County, Agents.Email, Agents.AgentName

> FROM Estate INNER JOIN Agents ON Estate.Agent = Agents.ID " & varSQL

> if Request.QueryString("page") = "" then vCurrentPage = 1 else

> vCurrentPage = Request.QueryString("page")

>

> Set rsEstate = Server.CreateObject("ADODB.Recordset")

> rsEstate.CursorLocation = 3 'Client

> rsEstate.CursorType = 3 'adOpenStatic

> rsEstate.CacheSize = cPageSize

> rsEstate.Open vSQL, cnCambEstate

> rsEstate.PageSize = cPageSize

>

> if rsEstate.EOF then

> %>

> <BR><BR>

> <center>

> <span class=aj>No records were found that matched your query in <B><%

> =request.querystring("Area")%></B>.<BR>Click<a href="hotelssearch.asp?

> area=<%=request.querystring("Area")%>"> <b>[here]</b></a> to try

again</h5>

> <table background="images/blackpool.jpg" alt="" align=center border=0

> width=550 height=391 cellpadding=0 cellspacing=0>

> <tr><td>

> </td></tr>

> </table>

> <%

> else

> rsEstate.AbsolutePage = vCurrentPage

> if session("debug") <> "" then Response.Write "<div

> class=debug><p><b>Pagecount:</b> <i>" & rsEstate.PageCount

> & "</i></p></div>"

> if session("debug") <> "" then Response.Write "<div

> class=debug><p><b>Current page:</b> <i>" & vCurrentPage & "</i></p></div>"

> vFrom = ((vCurrentPage - 1) * cPageSize) + 1

> vTo = vCurrentPage * cPageSize

> if vTo > rsEstate.RecordCount then vTo = rsEstate.RecordCount

> %>

> <BR><BR>

> <center>

> <h5>Found <%=rsEstate.RecordCount%> matching records for hotels in <font

> color="#000080"><b>"<%=request.querystring("Area")%>"</b></font>

> <br>  Displaying records <%=vFrom%> to <%=vTo%></h5>

> <DIV align="left"><form method="post" action="hotelssearch.asp?area=<%

> =request.querystring("Area")%>">

> <input type="Submit" value="Search Again">

> </form>

> </DIV>

> <div align="center">

> <%

> '-- Start Page Navigation --

> if rsEstate.RecordCount > cPageSize then

> if vCurrentPage > 1 then

> %>

> <a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page="

> & vCurrentPage,"") & "&page=" & vCurrentPage - 1%>">[<< Prev]</a> |

> <%

> else

> %>

> Prev |

> <%

> end if

> for i = 1 to rsEstate.PageCount

> vCurrentPage = vCurrentPage + 0 'Convert to Integer

> if i = vCurrentPage then

> Response.Write "<b>" & i & "</b> | "

> else

> %>

> <a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page="

> & vCurrentPage,"") & "&page=" & i%>"><%=i%></a> |

> <%

> end if

> next

> if vCurrentPage < rsEstate.PageCount then

> %>

> <a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page="

> & vCurrentPage,"") & "&page=" & vCurrentPage + 1%>">[Next >>]</a>

> <%

> else

> %>

> Next

> <%

> end if

> end if

> '-- End Page Navigation --

> %>

> </div>

> <hr width=400 align="center">

> <div align="center">

> <table border=0 cellpadding=5 cellspacing=0 width=80%>

> <%

> for i = 1 to rsEstate.PageSize

> vLocation = rsEstate("Number") ????????????(line 185)???????????????????

> if rsEstate("number") <> "" then vLocation = vLocation & ", "

> vLocation = vLocation & rsEstate("Street")

> if rsEstate("street") <> "" then vLocation = vLocation & ", "

> vLocation = vLocation & rsEstate("Area")

> if rsEstate("Area") <> "" then vLocation = vLocation & ", "

> vLocation = vLocation & rsEstate("County")

> if rsEstate("County") <> "" then vLocation = vLocation & ", "

> vLocation = vLocation & rsEstate("PostalCode")

> if rsEstate("PostalCode") <> "" then vLocation = vLocation & ". "

> description1 = rsEstate("description1")

> if rsEstate("description1") <> "" then description1 = description1 & " "

> description2 = rsEstate("description2")

> if rsEstate("description2") <> "" then description2 = description2 & " "

> description3 = rsEstate("description3")

> if rsEstate("description3") <> "" then description3 = description3 & " "

> Price = rsEstate("Price")

> if rsEstate("Price") <> "" then Price = Price & " "

> 'Type = rsEstate("Type")

> 'if rsEstate("Type") <> "" then Type = Type & " "

> Bed = rsEstate("Bed")

> if rsEstate("Bed") <> "" then Bed = Bed & " "

> Bed = rsEstate("Bed2")

> if rsEstate("Bed2") <> "" then Bed2 = Bed2 & " "

> Contact = rsEstate("Contact")

> if rsEstate("Contact") <> "" then Contact = Contact & " "

> Tel = rsEstate("Tel")

> if rsEstate("Tel") <> "" then Tel = Tel & " "

> Fax = rsEstate("Fax")

> if rsEstate("Fax") <> "" then Fax = Fax & " "

> Email = rsEstate("Email")

> if rsEstate("Email") <> "" then Email = Email & " "

> Website = rsEstate("Website")

> if rsEstate("Website") <> "" then Website = Website & " "

> ID = rsEstate("ID")

> if rsEstate("ID") <> "" then ID = ID & " "

> %>

> <tr>

> <td valign="top" width=460>

> <font size="+1"><b><%=rsEstate("AgentName")%

> ></b></font><br><br>

> <b><%=vLocation%></b>

> <p align="justify">

> <%=rsEstate("description1")%> 

> <%=rsEstate("description2")%> 

> <%=rsEstate("description3")%>

> </td>

> <script language=JavaScript>

> <!--

> function OpenWindow(vFilename){

> var vWindow;

> vWindow = window.open(vFilename, vFilename.substring(1,5),'toolbar=no,

> location=no, directories=no, status=no, menubar=no, scrollbars=no,

> resizable=no, width=700 height=525 left=0,top=0');

> }

> file://-->

> </script>

> <td valign="top" align="center" height="90"

> align="left"><font size="1"><br>(click here for more details)</font><BR><a

> href="javascript:OpenWindow('hotelresult.asp?ref=<%=rsEstate("ID")%

> >&Area=<%=request.querystring("Area")%>')"><img src="thumbimages/<%

> =rsEstate("Thumbs")%>" alt="<%=rsEstate("AgentName")%>" border=0

> hspace=5></A></td>

>

> </tr>

>

> <tr><td><p

> align="left"><BR>

> <b>Price Per Room:</b> £<%=rsEstate

> ("Price")%>     <b>Star Rating:</b> <%=rsEstate("type")%> Star

>    <b> Hotel Size:</b> <%=rsEstate("bed2")%> Bedrooms<BR>

> <b>Contact:</b><%=rsEstate

> ("Contact")%>   <b>Tel:</b> <%=rsEstate("Tel")%> 

>  <b>Fax:</b> <%=rsEstate("Fax")%>   <BR><b>Email:</b> <a

> href="mailto:<%=rsEstate("Email")%>"><%=rsEstate("Email")%></a>

>           <BR><b>Web Site:</b> <a href="<%=rsEstate

> ("Website")%>" TARGET="BLANK"><%=rsEstate("Website")%></a>

>

> </td>

> </tr><tr>

> <td height=15>

> </td></tr>

> </table>

>

> <%

> rsEstate.MoveNext

> %>

> <hr width=400 align="center">

> <table border=0 cellpadding=5 cellspacing=0 width=80%>

> <tr>

> <td colspan=3 align=center>

>

> </td>

> </tr>

> <%

> if rsEstate.EOF then exit for

> next

> %>

> <div align="center">

> <%

> '-- Start Page Navigation --

> if rsEstate.RecordCount > cPageSize then

> if vCurrentPage > 1 then

> %>

> <a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page="

> & vCurrentPage,"") & "&page=" & vCurrentPage - 1%>">Prev</a> |

> <%

> else

> %>

> Prev |

> <%

> end if

> for i = 1 to rsEstate.PageCount

> vCurrentPage = vCurrentPage + 0 'Convert to Integer

> if i = vCurrentPage then

> Response.Write "<b>" & i & "</b> | "

> else

> %>

> <a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page="

> & vCurrentPage,"") & "&page=" & i%>"><%=i%></a> |

> <%

> end if

> next

> if vCurrentPage < rsEstate.PageCount then

> %>

> <a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page="

> & vCurrentPage,"") & "&page=" & vCurrentPage + 1%>">Next</a>

> <%

> else

> %>

> Next

> <%

> end if

> end if

> '-- End Page Navigation --

> rsEstate.Close

> set rsEstates = nothing

> %>

> <p>

> <a href="#top">Back to the top</A>

> </div>

> <%

> end if

> %>

> <BR>

> </td></tr>

> </table>

> <!--#include file="footer.asp"-->

Message #3 by "David Billingham" <db@p...> on Mon, 20 Aug 2001 13:43:44 +0100
Hi



Why not write a bit of debug code to loop through the fields available at

that point and print the fields names. Then you'd be 100% sure whats there.



HTH



David





----- Original Message -----

From: "Ken Wilson" <kensan@n...>

To: "ASP_ADO_RDS" <asp_ado_rds@p...>

Sent: Monday, August 20, 2001 1:24 PM

Subject: [asp_ado_rds] Re: Help with error '800a0cc1'





> Hi AJ

>

> I had a similar situation a while back with an Access field I'd called

> Password, which gave me the same kind of problem, I renamed it thePassword

> and that fixed it.  I'm not sure that Password is actually an Access

> reserved word - I may be wrong - yet it still caused this problem.

>

> You say that you've renamed the field but it's still causing the same

error,

> I'm afraid I have no explanation for this. Perhaps if you renamed it to

> something that doesn't resemble in the slightest a keyword - sorry I know

> it's not very scientific but sometimes these things work.

>

> Also have you tried accessing the field by its ordinal number in the

table?

> I know this isn't the best way to go about it but at least you'd know that

> the field was being accessed by your code.

>

> Goodluck

>

> Ken

>

> ----- Original Message -----

> From: <aj@h...>

> To: "ASP_ADO_RDS" <asp_ado_rds@p...>

> Sent: Monday, August 20, 2001 11:01 AM

> Subject: [asp_ado_rds] Help with error '800a0cc1'

>

>

> > Hi im getting an error which has baffled me slightly...

> >

> > ADODB.Fields error '800a0cc1'

> > ADO could not find the object in the collection corresponding to the

name

> > or ordinal reference requested by the application.

> >

> > /ATWISP/hotels/hotelsresults.asp, line 185

> >

> > Firstly I don't know what it means, I have re-checked the database

(access

> > 2000) and all fields are present. I was advised that I had used a

reserved

> > word used by access?? but having changed the word I still get the same

> > error. The code is as follows: I have marked line 185... If anybody can

> > shed a little light on this I would be grateful.

> >

> > <%@ Language=VBScript %>

> >

> > <%

> > set cnCambEstate = Server.CreateObject("ADODB.Connection")

> > cnCambEstate.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &

> > Server.MapPath("../db/atwportal.mdb") & ";"

> > %>

> >

> > <html><head>

> > <!--#include file="../Stats/incstats.asp"-->

> > <%

> > StatLog

> > %>

> > <meta http-equiv=refresh content=300>

> >

> > </head>

> > <!--#include file="hotelmenu.asp"-->

> >

> > <table border=0 cellpadding=0 cellspacing=0 width=80%>

> > <tr><td>

> >

> > <CENTER>

> > <table border=0 height="100%" align="center">

> > <tr>

> > <td>

> > <%

> > Dim varPrice

> > varPrice = request.form("Price")

> >

> > 'Check routine for any characters that shouldn't be there!

> > If IsNumeric(varPrice) = False then

> > Call Procedure_Err

> > End If

> > If Instr(varPrice, "£") > 0 then

> > Call Procedure_Err

> > End If

> > If Instr(varPrice, ".") > 0 then

> > Call Procedure_Err

> > End If

> > If Instr(varPrice, ",") > 0 then

> > Call Procedure_Err

> > End If

> >

> > 'Procedure called on error

> > Sub Procedure_Err

> > %>

> > <br><br><br>

> > <h2><i>Incorrect Entry</i></h2>

> > <font color="Red">An incorrect entry has been

> > made.</font><br>

> > <b><I>This usually occurs if the "Price" field has

> > been left blank or data entered incorrectly</I></b><br>

> > Please return to the previous page and re-enter

> > the data.<br>

> > NOTE: Only numbers (without decimal points)should

> > be entered in the "Price" field.<BR> DO NOT enter any other characters

> > (e.g. "£ , - ." etc)<br>

> > Click the search button to return to the previous

> > page.

> > <p>

> > <form method="post"

> > action="hotelssearch.asp?area=<%=request.querystring("Area")%>">

> > <input type="Submit"

> > value="search">

> > </form>

> > </p>

> > <br><br>

> > </td>

> > </tr>

> > </table>

> > <br><br><br>

> > <br><br><br>

> > <br><br><br>

> > <br><br><br>

> > <br><br><br>

> > <br><br><br>

> > <!--#include file="footer.asp"-->

> >

> > <%

> > Response.end

> > End Sub

> >

> > '--- Begin Search Formatting ---

> >

> > dim Searches()

> > redim Searches(0)

> > Searches(0) = "1=1"

> >

> > if Request("Price") = "" Then

> > varSQL = ""

> > Else

> > varSQL = "WHERE estate.Price <= " & Request("Price")

> > End if

> >

> > if Request("Type") <> "" Then

> > if varSQL <> "" Then

> > varSQL = varSQL & " AND estate.Type = '" & Request("Type") & "'"

> > else

> > varSQL = "WHERE estate.Type = '" & Request("Type") & "'"

> > end if

> > end if

> >

> > if Request("Bed") <> "" Then

> > if varSQL <> "" Then

> > varSQL = varSQL & " AND  estate.Bed = '" & Request("Bed") & "'"

> > else

> > varSQL = "WHERE estate.Bed = '" & Request("Bed") & "'"

> > End if

> > end if

> >

> > 'response.write varSQL & "<br>"

> >

> > '--- End search formatting. ---

> >

> > cPageSize = 2

> > vSearchString = join(Searches," AND ")

> > if Request.QueryString("Agent") <> "" then vSearchString 

"Estate.Agent="

> > + Request.QueryString("Agent")

> > vSQL = "SELECT Estate.*, estate.ID, estate.Number, estate.Street,

> > estate.Area, estate.PostalCode, estate.description1,

estate.description2,

> > estate.description3, estate.Price, estate.Type, estate.Bed, estate.Bed2,

> > estate.Contact, estate.Tel, estate.Fax, estate.Email, estate.Website,

> > estate.Thumbs, estate.Image, estate.County, Agents.Email,

Agents.AgentName

> > FROM Estate INNER JOIN Agents ON Estate.Agent = Agents.ID " & varSQL

> > if Request.QueryString("page") = "" then vCurrentPage = 1 else

> > vCurrentPage = Request.QueryString("page")

> >

> > Set rsEstate = Server.CreateObject("ADODB.Recordset")

> > rsEstate.CursorLocation = 3 'Client

> > rsEstate.CursorType = 3 'adOpenStatic

> > rsEstate.CacheSize = cPageSize

> > rsEstate.Open vSQL, cnCambEstate

> > rsEstate.PageSize = cPageSize

> >

> > if rsEstate.EOF then

> > %>

> > <BR><BR>

> > <center>

> > <span class=aj>No records were found that matched your query in <B><%

> > =request.querystring("Area")%></B>.<BR>Click<a href="hotelssearch.asp?

> > area=<%=request.querystring("Area")%>"> <b>[here]</b></a> to try

> again</h5>

> > <table background="images/blackpool.jpg" alt="" align=center border=0

> > width=550 height=391 cellpadding=0 cellspacing=0>

> > <tr><td>

> > </td></tr>

> > </table>

> > <%

> > else

> > rsEstate.AbsolutePage = vCurrentPage

> > if session("debug") <> "" then Response.Write "<div

> > class=debug><p><b>Pagecount:</b> <i>" & rsEstate.PageCount

> > & "</i></p></div>"

> > if session("debug") <> "" then Response.Write "<div

> > class=debug><p><b>Current page:</b> <i>" & vCurrentPage &

"</i></p></div>"

> > vFrom = ((vCurrentPage - 1) * cPageSize) + 1

> > vTo = vCurrentPage * cPageSize

> > if vTo > rsEstate.RecordCount then vTo = rsEstate.RecordCount

> > %>

> > <BR><BR>

> > <center>

> > <h5>Found <%=rsEstate.RecordCount%> matching records for hotels in <font

> > color="#000080"><b>"<%=request.querystring("Area")%>"</b></font>

> > <br>  Displaying records <%=vFrom%> to <%=vTo%></h5>

> > <DIV align="left"><form method="post" action="hotelssearch.asp?area=<%

> > =request.querystring("Area")%>">

> > <input type="Submit" value="Search Again">

> > </form>

> > </DIV>

> > <div align="center">

> > <%

> > '-- Start Page Navigation --

> > if rsEstate.RecordCount > cPageSize then

> > if vCurrentPage > 1 then

> > %>

> > <a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page="

> > & vCurrentPage,"") & "&page=" & vCurrentPage - 1%>">[<< Prev]</a>

|

> > <%

> > else

> > %>

> > Prev |

> > <%

> > end if

> > for i = 1 to rsEstate.PageCount

> > vCurrentPage = vCurrentPage + 0 'Convert to Integer

> > if i = vCurrentPage then

> > Response.Write "<b>" & i & "</b> | "

> > else

> > %>

> > <a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page="

> > & vCurrentPage,"") & "&page=" & i%>"><%=i%></a> |

> > <%

> > end if

> > next

> > if vCurrentPage < rsEstate.PageCount then

> > %>

> > <a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page="

> > & vCurrentPage,"") & "&page=" & vCurrentPage + 1%>">[Next >>]</a>

> > <%

> > else

> > %>

> > Next

> > <%

> > end if

> > end if

> > '-- End Page Navigation --

> > %>

> > </div>

> > <hr width=400 align="center">

> > <div align="center">

> > <table border=0 cellpadding=5 cellspacing=0 width=80%>

> > <%

> > for i = 1 to rsEstate.PageSize

> > vLocation = rsEstate("Number") ????????????(line 185)???????????????????

> > if rsEstate("number") <> "" then vLocation = vLocation & ", "

> > vLocation = vLocation & rsEstate("Street")

> > if rsEstate("street") <> "" then vLocation = vLocation & ", "

> > vLocation = vLocation & rsEstate("Area")

> > if rsEstate("Area") <> "" then vLocation = vLocation & ", "

> > vLocation = vLocation & rsEstate("County")

> > if rsEstate("County") <> "" then vLocation = vLocation & ", "

> > vLocation = vLocation & rsEstate("PostalCode")

> > if rsEstate("PostalCode") <> "" then vLocation = vLocation & ". "

> > description1 = rsEstate("description1")

> > if rsEstate("description1") <> "" then description1 = description1 & " "

> > description2 = rsEstate("description2")

> > if rsEstate("description2") <> "" then description2 = description2 & " "

> > description3 = rsEstate("description3")

> > if rsEstate("description3") <> "" then description3 = description3 & " "

> > Price = rsEstate("Price")

> > if rsEstate("Price") <> "" then Price = Price & " "

> > 'Type = rsEstate("Type")

> > 'if rsEstate("Type") <> "" then Type = Type & " "

> > Bed = rsEstate("Bed")

> > if rsEstate("Bed") <> "" then Bed = Bed & " "

> > Bed = rsEstate("Bed2")

> > if rsEstate("Bed2") <> "" then Bed2 = Bed2 & " "

> > Contact = rsEstate("Contact")

> > if rsEstate("Contact") <> "" then Contact = Contact & " "

> > Tel = rsEstate("Tel")

> > if rsEstate("Tel") <> "" then Tel = Tel & " "

> > Fax = rsEstate("Fax")

> > if rsEstate("Fax") <> "" then Fax = Fax & " "

> > Email = rsEstate("Email")

> > if rsEstate("Email") <> "" then Email = Email & " "

> > Website = rsEstate("Website")

> > if rsEstate("Website") <> "" then Website = Website & " "

> > ID = rsEstate("ID")

> > if rsEstate("ID") <> "" then ID = ID & " "

> > %>

> > <tr>

> > <td valign="top" width=460>

> > <font size="+1"><b><%=rsEstate("AgentName")%

> > ></b></font><br><br>

> > <b><%=vLocation%></b>

> > <p align="justify">

> > <%=rsEstate("description1")%> 

> > <%=rsEstate("description2")%> 

> > <%=rsEstate("description3")%>

> > </td>

> > <script language=JavaScript>

> > <!--

> > function OpenWindow(vFilename){

> > var vWindow;

> > vWindow = window.open(vFilename, vFilename.substring(1,5),'toolbar=no,

> > location=no, directories=no, status=no, menubar=no, scrollbars=no,

> > resizable=no, width=700 height=525 left=0,top=0');

> > }

> > file://-->

> > </script>

> > <td valign="top" align="center" height="90"

> > align="left"><font size="1"><br>(click here for more

details)</font><BR><a

> > href="javascript:OpenWindow('hotelresult.asp?ref=<%=rsEstate("ID")%

> > >&Area=<%=request.querystring("Area")%>')"><img src="thumbimages/<%

> > =rsEstate("Thumbs")%>" alt="<%=rsEstate("AgentName")%>" border=0

> > hspace=5></A></td>

> >

> > </tr>

> >

> > <tr><td><p

> > align="left"><BR>

> > <b>Price Per Room:</b> £<%=rsEstate

> > ("Price")%>     <b>Star Rating:</b> <%=rsEstate("type")%> Star

> >    <b> Hotel Size:</b> <%=rsEstate("bed2")%> Bedrooms<BR>

> > <b>Contact:</b><%=rsEstate

> > ("Contact")%>   <b>Tel:</b> <%=rsEstate("Tel")%> 

> >  <b>Fax:</b> <%=rsEstate("Fax")%>   <BR><b>Email:</b> <a

> > href="mailto:<%=rsEstate("Email")%>"><%=rsEstate("Email")%></a>

> >           <BR><b>Web Site:</b> <a href="<%=rsEstate

> > ("Website")%>" TARGET="BLANK"><%=rsEstate("Website")%></a>

> >

> > </td>

> > </tr><tr>

> > <td height=15>

> > </td></tr>

> > </table>

> >

> > <%

> > rsEstate.MoveNext

> > %>

> > <hr width=400 align="center">

> > <table border=0 cellpadding=5 cellspacing=0 width=80%>

> > <tr>

> > <td colspan=3 align=center>

> >

> > </td>

> > </tr>

> > <%

> > if rsEstate.EOF then exit for

> > next

> > %>

> > <div align="center">

> > <%

> > '-- Start Page Navigation --

> > if rsEstate.RecordCount > cPageSize then

> > if vCurrentPage > 1 then

> > %>

> > <a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page="

> > & vCurrentPage,"") & "&page=" & vCurrentPage - 1%>">Prev</a> |

> > <%

> > else

> > %>

> > Prev |

> > <%

> > end if

> > for i = 1 to rsEstate.PageCount

> > vCurrentPage = vCurrentPage + 0 'Convert to Integer

> > if i = vCurrentPage then

> > Response.Write "<b>" & i & "</b> | "

> > else

> > %>

> > <a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page="

> > & vCurrentPage,"") & "&page=" & i%>"><%=i%></a> |

> > <%

> > end if

> > next

> > if vCurrentPage < rsEstate.PageCount then

> > %>

> > <a href="hotelsresults.asp?<%=replace(Request.QueryString,"&page="

> > & vCurrentPage,"") & "&page=" & vCurrentPage + 1%>">Next</a>

> > <%

> > else

> > %>

> > Next

> > <%

> > end if

> > end if

> > '-- End Page Navigation --

> > rsEstate.Close

> > set rsEstates = nothing

> > %>

> > <p>

> > <a href="#top">Back to the top</A>

> > </div>

> > <%

> > end if

> > %>

> > <BR>

> > </td></tr>

> > </table>

> > <!--#include file="footer.asp"-->

Message #4 by aj@h... on Tue, 21 Aug 2001 16:36:45
Thanks for your suggestions - problem solved.

  Return to Index