469,336 Members | 5,233 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

This key is already associated with an element of this collection

I am getting this error message with the following piece of code.

sqlSelect = "Select * from UserPermissions where UserID = " & UserID &
";"
set tbl = GetRecordset(sqlSelect, false)
while not tbl.eof
response.write ("<br>key: " & tbl("SectionID"))
Permissions.add tbl("SectionID"), 1
tbl.movenext
wend

The screen displays
key: 1
key: 2

I've been staring at this problem for two hours now..any suggestions
would be appreciated.
Jul 19 '05 #1
2 15100
What is Permissions? A dictionary object? If so, this means that you have
duplicate values in your SectionID column and as such, you cannot use those
values as a key in your dictionary object.

Ray at work

"dalberon" <co********@hotmail.com> wrote in message
news:4c**************************@posting.google.c om...
I am getting this error message with the following piece of code.

sqlSelect = "Select * from UserPermissions where UserID = " & UserID &
";"
set tbl = GetRecordset(sqlSelect, false)
while not tbl.eof
response.write ("<br>key: " & tbl("SectionID"))
Permissions.add tbl("SectionID"), 1
tbl.movenext
wend

The screen displays
key: 1
key: 2

I've been staring at this problem for two hours now..any suggestions
would be appreciated.

Jul 19 '05 #2
http://www.aspfaq.com/2485


"dalberon" <co********@hotmail.com> wrote in message
news:4c**************************@posting.google.c om...
I am getting this error message with the following piece of code.

sqlSelect = "Select * from UserPermissions where UserID = " & UserID &
";"
set tbl = GetRecordset(sqlSelect, false)
while not tbl.eof
response.write ("<br>key: " & tbl("SectionID"))
Permissions.add tbl("SectionID"), 1
tbl.movenext
wend

The screen displays
key: 1
key: 2

I've been staring at this problem for two hours now..any suggestions
would be appreciated.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by kbhat | last post: by
5 posts views Thread by J.Marsch | last post: by
3 posts views Thread by TKapler | last post: by
1 post views Thread by Wolfgang Draxinger | last post: by
3 posts views Thread by Victor Bazarov | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by haryvincent176 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.