473,388 Members | 1,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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 15266
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kbhat | last post by:
The purpose of this puzzle is not to test your knowledge and understanding of templates. Rather, it is to help me understand why template based containers of entities behave differently than...
5
by: J.Marsch | last post by:
All: I have an interesting problem in front of me. does this sound reasonable, or ridiculous? I have to build something that is sort of like a style sheet for Windows controls. Picture a...
4
by: chaz | last post by:
here is the html : <br> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="<%=LABEL_WIDTH%>" class="formtext"><%= HTEXT("Connection type:")%></td> <td...
3
by: TKapler | last post by:
i got this simmple function, It stays on onChange on select and on change it hides all objects with ID equal to select name plus the optionvalue. It works perfectly in Opera and FF, but IE crashes...
1
by: Wolfgang Draxinger | last post by:
I'm currently developing vegetation creation scripts for the Blender 3D modelling software. The first attempts work nice, but they're far to inflexible IMHO. First let me introduce how the...
6
by: ashok.dhananjeyan | last post by:
Hi, Actually , I wrote one javascript to retrieve the name of the form in one particular page. what i did in this page is, <script> function checkbutton() {
2
by: chandru4ni | last post by:
Hello, I am going through a document in which is defined a XML complex type(EventType) for handling events. But the EventType does not have an associated namespace for it. All other complext...
3
by: Victor Bazarov | last post by:
jl_post@hotmail.com wrote: Yes, certainly. Actually 'delete' is an operator, not a function. The parens are superfluous. There is really no need for that.
1
by: sivakrishna546 | last post by:
using System; using System.Collections; using System.ComponentModel; using System.Security.Permissions; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.