PDA

View Full Version : Item cannot befound - please help!


jarv
03-29-2010, 07:00 PM
I get the error: ADODB.Recordset error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/testsite/viewpic.asp, line 33


set sp = objconn.execute("SELECT * FROM shop INNER JOIN Categories ON shop.CategoryID=Categories.CategoryID WHERE ImageID =" & ImageID)
Dim CategoryID : CategoryID = sp("shop.CategoryID")



Line 33:

Dim CategoryID : CategoryID = sp("shop.CategoryID")

Old Pedant
03-29-2010, 07:12 PM
Dim CategoryID : CategoryID = sp("CategoryID")

You can't add the table name to the field name when getting a field from the recordset *UNLESS* you specifically named it that way in the SQL query.

That is, if your SQL had been
SELECT shop.CategoryID, shop.CategoryName FROM shop ...

*then* you could have used the full name.

98% of the time, though, there is no reason to use the full name, so don't.

jarv
03-29-2010, 08:15 PM
thanks again Old Pendant, I did actually get around this in the end by using CategoryID in the QueryString