Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-21-2002, 04:39 PM   PM User | #1
Jodda
New Coder

 
Join Date: Jul 2002
Location: Rhondda, Wales, UK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Jodda is an unknown quantity at this point
Unhappy Item cannot be found in the collection corresponding to the requested name or ordinal

Hi there,

Has any 1 had problems with the error message below while inserting an SQL record?
-----------------------------------------
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.

-----------------------------------------------
The error points to the following line:
-----------------------------------------------
Set RequestRegisterDB = Server.CreateObject("ADODB.Recordset")
sSourceString = "EXEC RegisterRequest " & txtLevel & ",'" & txtFullName & "','" & txtEmail & "','" & txtPhone & "','" & txtFax & "','" & txtComp & "','" & txtPos & "','" & txtCompAddr & "','" & txtSoftLevel & "'"
RequestRegisterDB.Open sSourceString, Application("ConnectionStringAdmin")
lRequestID = CLng(RequestRegisterDB.Fields("RequestID").Value)
RequestRegisterDB.Close
Set RequestRegisterDB = Nothing
--------------------------------------------
When inserting a record, if a submitted email matches an existing email address, RequestID = -1, else the identity number is returned.

The record is correctly inserted evan thow the error message is shown, and if the page is refreshed, the return value of -1 is correctly pickep up and processed, seems like the first attempt returns nothing.

I Response.Write'd sSourceString, copied the wrote text and executed in the 'Query Analyser' and it worked fine - returning a correct 'RequestID'.

Happened to any 1 else before? If so, please say how to resolve..
Jodda is offline   Reply With Quote
Old 08-21-2002, 06:20 PM   PM User | #2
whammy
Senior Coder

 
Join Date: Jun 2002
Location: 41° 8' 52" N -95° 53' 31" W
Posts: 3,660
Thanks: 0
Thanked 0 Times in 0 Posts
whammy is an unknown quantity at this point
That error in my experience means you either misspelled a field name, or are looking for a field that isn't in the database.

__________________
Former ASP Forum Moderator - I'm back!

If you can teach yourself how to learn, you can learn anything. ;)
whammy is offline   Reply With Quote
Old 08-22-2002, 09:33 AM   PM User | #3
Jodda
New Coder

 
Join Date: Jul 2002
Location: Rhondda, Wales, UK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Jodda is an unknown quantity at this point
I've triple checked spelling on var names, the line was originally:

lRequestID = CLng(RequestRegisterDB.Fields(0).Value)

but tried the var name as a case of elimination, the field def exsists for the field returned is the 'Identity', which is the first field in the database. Nevermind, suppose i'll resort to brute force and search for me hammer
Jodda is offline   Reply With Quote
Old 08-22-2002, 11:00 AM   PM User | #4
Jodda
New Coder

 
Join Date: Jul 2002
Location: Rhondda, Wales, UK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Jodda is an unknown quantity at this point
Found the problem,

/* Fixes "Closed ADO RecordSet" problem when using temp table */
SET NOCOUNT ON
Jodda is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 04:15 AM.


Advertisement
Log in to turn off these ads.