Advertisement

02.05.2008 at 06:06PM PST, ID: 23140114
[x]
Attachment Details

Item cannot be found in the collection...

Asked by saturation in Active Server Pages (ASP)

Tags: ,

I am trying to insert a single field call FIRST_NAME into the database but am getting an error with the following--and the field name is definitely on the form.  What am I doing wrong?

ERROR LINE
objRS(Request.Form.Key(x))

ERROR:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
Set objRS = CreateObject("ADODB.Recordset")
	objRS.CursorLocation = 3
	objRS.Open "APPLICANTS", strDataSourceName, adOpenStatic, adLockOptimistic
 
	objRS.AddNew
	Dim x
	For x = 1 to Request.Form.Count
		'Response.Write Request.Form.Key(x) & ": "
		'Response.Write Request.Form.Item(x) & "<br />"
		sField = Request.Form.Key(x)
 
		if objRS(sField) = "FIRST_NAME" then
			objRS(Request.Form.Key(x)) = Request.Form.Item(x)
		end if
	Next
	objRS.Update
[+][-]02.05.2008 at 06:11PM PST, ID: 20828949

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: ASP, IE
Sign Up Now!
Solution Provided By: vs1784
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02.05.2008 at 06:14PM PST, ID: 20828959

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.05.2008 at 06:30PM PST, ID: 20829013

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.05.2008 at 06:34PM PST, ID: 20829019

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.05.2008 at 08:09PM PST, ID: 20829418

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.05.2008 at 08:11PM PST, ID: 20829429

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.05.2008 at 08:18PM PST, ID: 20829459

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628