If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
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, 21:12
Mirador Mirador is offline
Registered User
 
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, 21:27
Mirador Mirador is offline
Registered User
 
Join Date: Jan 2004
Location: Oslo
Posts: 45
problem solved!

solved.
Reply With Quote
  #3 (permalink)  
Old 01-09-04, 21: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

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