473,583 Members | 3,129 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(sq lSelect, 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 15278
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********@hot mail.com> wrote in message
news:4c******** *************** ***@posting.goo gle.com...
I am getting this error message with the following piece of code.

sqlSelect = "Select * from UserPermissions where UserID = " & UserID &
";"
set tbl = GetRecordset(sq lSelect, 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********@hot mail.com> wrote in message
news:4c******** *************** ***@posting.goo gle.com...
I am getting this error message with the following piece of code.

sqlSelect = "Select * from UserPermissions where UserID = " & UserID &
";"
set tbl = GetRecordset(sq lSelect, 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
1424
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 template based containers of pointers to entities, specifically with respect to dynamic binding. The following code snippet explains what I am talking...
5
1284
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 collection of dissimilar value types: a couple of Color types, some ints, some strings etc.
4
4877
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 class="formtext"> <input type="radio" class="inputRadio" id="dbStatus" name="dbStatus" value="1" onclick="changeDbStatus(1)" <%if dbStatus=1 then%checked
3
1862
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 because says that options object is null the problem is in for (optionId in what.options) It seems that IE does NOT return the list of options,...
1
1471
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 system works: The user supplies a series of building elements of the plants to be generated (e.g. stem, stipe, leaf, branches, blossom) and associated...
6
3862
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
1469
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 types defined in the document have a namespace associated with them. So, I want to know whether is it mandatory to have the namespace associated with...
3
1580
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
1372
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 Samples.AspNet.Controls.CS {
0
7896
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7828
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8186
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8329
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6583
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5704
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5377
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3821
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1436
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.