This key is already associated with an element of this collection

D

dalberon

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.
 
R

Ray at

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top