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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODB.Recordset (0x800A0CC1) Error

Status
Not open for further replies.

blondebier

Programmer
Jun 19, 2003
142
0
0
GB
Any ideas what the following error means?

Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/addprod.asp, line 54

This is line 54 of addprod.asp:

set rscatlist=db.execute("select name,productid from products where catcode=" & rsprod("catcode") & " order by name")

I include a db connection file db.asp:

<!-- #include file=&quot;adovbs.inc&quot; -->
<%

dim db
dim strConn

strConn = &quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot; & _
&quot;Data Source=C:\inetpub\ & _
&quot;Persist Security Info=False&quot;

Set db = Server.CreateObject(&quot;ADODB.Connection&quot;)
db.open strConn
%>

Any help would be greatly appreciated.
 
I would say the error is referring to this part of that line:

Code:
rsprod(&quot;catcode&quot;)

How are you creating the rsprod recordset? Can you give us that part of your code?

--James
 
This is the rsprod recordset:

set rsprod=db.execute(&quot;SELECT * FROM products INNER JOIN categories ON products.catcode = categories.catcode WHERE productid = &quot; & productid)

Thanks.
 
You might need to refer to the column like this as there is more than one column called catcode in the resultset:

Code:
rsprod(&quot;products.catcode&quot;)

As a general rule, specifying the columns you want to return is usually preferred to
Code:
SELECT *
for a number of reasons, one of which is nicely illustrated here! ;-)

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top