Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Need help on error : Item cannot be found in the collection...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-09-04, 22:12
Mirador Mirador is offline
Master Chinchilla
 
Join Date: Jan 2004
Location: Oslo
Posts: 45
Question Need help on error : Item cannot be found in the collection...

Hi and tnx for reading my post..

I am complete stuck at this error.. i have searched the net for this, found some matches but i cannot seem to understand what's wrong with this code...

If someone got any clue how to fix this i will be *forever* happy !!

PS! Full paste of code on the bottom of the post. Using the webwizguide code at url : http://www.webwizguide.com/asp/tutor...m_database.asp

I get the error :
-----------START--------------
Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/psy/delete_select.asp, line 18
-----------END--------------
when i'm trying to get the ID_no. (.. i think that's the problem..)
Here is line nr 18 :
-------------START-------------------------
Response.Write ("<a href=""delete_entry.asp?ID=" & recset("ID_no") & """>")
--------------END---------------------------



----------- FULL CODE --------------------
Dim conn
Dim recset
Dim sSql

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=PsyDb"

Set recset = Server.CreateObject("ADODB.Recordset")
sSql = "SELECT Album.* FROM Album;"
recset.Open sSql, conn

Do While Not recset.EOF
Response.Write ("<br>")
Response.Write ("<a href=""delete_entry.asp?ID=" & recset("ID_no") & """>")
Response.Write (recset("Artist"))
Response.Write ("</a>")
Response.Write ("<br>")
Response.Write (recset("Alb"))
Response.Write ("<br>")
recset.MoveNext
Loop

recset.Close
Set recset = nothing
Set conn = nothing
---------------END FULL CODE---------------------

--------- START DELETE_ENTRY.ASP CODE -------------
Dim conn
Dim rsDeleteEntry
Dim sSql
Dim lngRecordNo

lngRecordNo = CLng(Request.QueryString("ID"))

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=PsyDb"

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

sSql = "SELECT Album.* FROM Album WHERE ID_no=" & lngRecordNo

rsDeleteEntry.Locktype = 3

rsDeleteEntry.Open sSql, conn

rsDeleteEntry.Delete

Set rsDeleteEntry = nothing
Set conn = nothing

Response.Redirect "delete_select.asp"
-------------END-----------------------------------
Reply With Quote
  #2 (permalink)  
Old 01-09-04, 22:27
Mirador Mirador is offline
Master Chinchilla
 
Join Date: Jan 2004
Location: Oslo
Posts: 45
problem solved!

solved.
Reply With Quote
  #3 (permalink)  
Old 01-09-04, 22:31
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
The query

sSql = "SELECT Album.* FROM Album;"

should be

sSql = "SELECT Album.* FROM Album"
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On