Using VB Collection, there is a restriction that only one member can be associated with a particular key.
E.g:
ob.Add "user1", "key1"
ob.Add "user2", "key1" <---------- Error - one key can have only 1 member
Please advise of something else that can accomodate more than 1 member for the same key
Thanks
7 2377
Hi
Using VB Collection, there is a restriction that only one member can be associated with a particular key.
E.g:
ob.Add "user1", "key1"
ob.Add "user2", "key1" <---------- Error - one key can have only 1 member
Please advise of something else that can accomodate more than 1 member for the same key
Thanks
I know (assume!) ob is an object collection, but a collection of which objects ?
MTB
MTB
i dont understand what you mean.
but I've got this:
Private ob As Collection
Hi
I know (assume!) ob is an object collection, but a collection of which objects ?
MTB
Using VB Collection, there is a restriction that only one member can be associated with a particular key.
E.g:
ob.Add "user1", "key1"
ob.Add "user2", "key1" <---------- Error - one key can have only 1 member
Please advise of something else that can accomodate more than 1 member for the same key
Thanks
To the best of my knowledge, each member of a Collection must be defined by a Unique Key, so the Collection route is out. You may be able to accomplish this via a Multidimensional Array or a Table Structure where the combination of User and Key (Composite Key) is Unique so that multiple Users can be assigned to the same Key. You can then reference the Users assigned to a specific Key by SQL, Recordset, etc.
NeoPa 32,556
Expert Mod 16PB
Hi
I know (assume!) ob is an object collection, but a collection of which objects ?
MTB
In Access the Collection object is not restricted to contain objects of any particular type.
NeoPa 32,556
Expert Mod 16PB
Using VB Collection, there is a restriction that only one member can be associated with a particular key.
E.g:
ob.Add "user1", "key1"
ob.Add "user2", "key1" <---------- Error - one key can have only 1 member
Please advise of something else that can accomodate more than 1 member for the same key
Thanks
More fundamentally, do you really want to store two items with the same key. The answer's almost certainly "No."
Do you have the parameters the right way around?
The key parameter should be a unique identifier for that particular object (instance of an object technically).
Yes in my example, i need to associate more than 1 member with one Key
Its simply 1 to many relationship.
I thought there would be something similar to Collection in VB that i can use. But if there isn't i would go for making an 2D array.
More fundamentally, do you really want to store two items with the same key. The answer's almost certainly "No."
Do you have the parameters the right way around?
The key parameter should be a unique identifier for that particular object (instance of an object technically).
NeoPa 32,556
Expert Mod 16PB
It doesn't make a lot of sense to store them all in the same collection then I suggest.
What if you store the one side of the situation in one collection and the many side in another. Just as in a database, the many key could consist of the one key as well as an extra unique part to identify it uniquely.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Marc L'Ecuyer |
last post by:
Hi,
I have a collection class derived from CollectionBase. This collection can
add items of my class MyItem. In my class MyItem, I have a Selected
property. When this property is set to true, I...
|
by: Sundown |
last post by:
I am trying to create a custom button control for the web that, when clicked,
disables and changes the text of itself and a bunch of other controls (in the
collection). My goal is to end up with a...
|
by: Edward Diener |
last post by:
In C++ an overridden virtual function in a derived class must have the exact
same signature of the function which is overridden in the base class, except
for the return type which may return a...
|
by: Brian |
last post by:
NOTE ALSO POSTED IN
microsoft.public.dotnet.framework.aspnet.buildingcontrols
I have solved most of my Server Control Collection property issues.
I wrote an HTML page that describes all of the...
|
by: Michael |
last post by:
Dear all ..
If I want to use develop a user control and declare a public property which
the type is System.Windows.Forms.GridTableStylesCollection
For example :
Public Class LookAndView...
|
by: Jamey Shuemaker |
last post by:
I'm in the process of expanding my knowledge and use of Class Modules.
I've perused MSDN and this and other sites, and I'm pretty comfortable
with my understanding of Class Modules with the...
|
by: Arthur Dent |
last post by:
How do you sort a generic collection derived from
System.Collections.ObjectModel.Collection?
Thanks in advance,
- Arthur Dent
|
by: Erick |
last post by:
I've created a class called Procs and a collection class called
Processes which uses a hastable object to store the Procs.
Now i want to enumerate with the "For each" to extract all the Procs in...
|
by: holysmokes99 |
last post by:
I have run the VB.Net upgrade wizard to get a vb6 project up to VB.Net
1.1. This is a class library that is referenced by another VB6 app. I
have exposed it to for COM access. The problem is that...
|
by: gasfusion |
last post by:
Hey guys.
I'm building an object collection which will be a part of a Data Access Layer i am currently working on. However, i am having some issues iterating through a collection.
This is what...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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,...
|
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...
| |