467,915 Members | 1,118 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

Microsoft VBScript runtime error '800a01c9'

Hi

I am getting this error which is frustrating me a lot

Microsoft VBScript runtime error '800a01c9'

This key is already associated with an element of this collection

/process.asp, line 362

the following is the code snippet:

Sub AddItemToCart(iItemID, iItemCount)
aParameters = GetItemParameters(iItemID)

If dictCart.Exists(iItemID) Then

If CInt(aParameters(6)) > CInt(dictCart(iItemID)) then
dictCart(iItemID) = dictCart(iItemID) + iItemCount
Response.Write "<font face=Verdana color=#c8c8c8 size=2>" &
iItemCount & " of item # " & iItemID & " have been added to your
cart.<BR><BR></font>" & vbCrLf
Else
Response.Write "<font face=Verdana color=#c8c8c8 size=2>" & "There
is no more stock available to add<BR><BR></font>" & vbCrLf
End If

Else
If CInt(aParameters(6)) > CInt(dictCart(iItemID)) then
dictCart.Add iItemID, iItemCount >>>>>>>> line 362 <<<<<<<<<<<<<
Response.Write "<font face=Verdana color=#c8c8c8 size=2>" &
iItemCount & " of item # " & iItemID & " have been added to your
cart.<BR><BR></font>" & vbCrLf
Else
Response.Write "<font face=Verdana color=#c8c8c8 size=2>" & "There
is no more stock available to add<BR><BR></font>" & vbCrLf
End If

End If

End Sub
Please suggest me if you can find some error

regards

Rahul
Jul 19 '05 #1
  • viewed: 11759
Share:
3 Replies
That means that you're trying to add something into your dictionary object
with the same key as another item that already exists. For example:

This will cause that error:
objYourDictionaryObject.Add "key1", "Bird"
objYourDictionaryObject.Add "key1", "Cat"

This will not cause an error:
objYourDictionaryObject.Add "key1", "Bird"
objYourDictionaryObject.Add "key2", "Cat"

See how the keys are different? They must be.

"Rahul Bakshi" <rb*****@usc.edu> wrote in message
news:f1**************************@posting.google.c om...
Hi

I am getting this error which is frustrating me a lot

Microsoft VBScript runtime error '800a01c9'

This key is already associated with an element of this collection

/process.asp, line 362

the following is the code snippet:


Sub AddItemToCart(iItemID, iItemCount)
aParameters = GetItemParameters(iItemID)

If dictCart.Exists(iItemID) Then

If CInt(aParameters(6)) > CInt(dictCart(iItemID)) then
dictCart(iItemID) = dictCart(iItemID) + iItemCount
Response.Write "<font face=Verdana color=#c8c8c8 size=2>" &
iItemCount & " of item # " & iItemID & " have been added to your
cart.<BR><BR></font>" & vbCrLf
Else
Response.Write "<font face=Verdana color=#c8c8c8 size=2>" & "There
is no more stock available to add<BR><BR></font>" & vbCrLf
End If

Else
If CInt(aParameters(6)) > CInt(dictCart(iItemID)) then
dictCart.Add iItemID, iItemCount >>>>>>>> line 362 <<<<<<<<<<<<<
Response.Write "<font face=Verdana color=#c8c8c8 size=2>" &
iItemCount & " of item # " & iItemID & " have been added to your
cart.<BR><BR></font>" & vbCrLf
Else
Response.Write "<font face=Verdana color=#c8c8c8 size=2>" & "There
is no more stock available to add<BR><BR></font>" & vbCrLf
End If

End If

End Sub
Please suggest me if you can find some error

regards

Rahul

Jul 19 '05 #2
Hi

I know the cause of the error

However i do not understand how the dictionary already has those keys
as this is the first item I am trying to add.

thanks for the quick response

regards
Rahul

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
Throw in some response.writes and watch the keys.

Ray at home

"Rahul Bakshi" <rb*****@usc.edu> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi

I know the cause of the error

However i do not understand how the dictionary already has those keys
as this is the first item I am trying to add.

thanks for the quick response

regards
Rahul

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by =?Utf-8?B?TWF0dCBDYWxob29u?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.