o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

adding to a collection -

I'm unfamilar with how to add an item(record) to a collection. I've already established the collection but keep getting errors on the add. My code looks like:

collection.add (


When I put the first ( in place VB opens up this info box listing all my collection elements and their data type. Is it kind of like a sql insert where first you list the field names and then the values?
such as

collection.add (model,year,color) (buick, 98, blue). That does not work nor does it look right. Any assistance is appreciated.

I've attached a print screen (.gif)

 

adding to a collection -
I'm unfamilar with how to add an item(record) to a collection. I've already established the collection but keep getting errors on the add. My code looks like: collection.add ( When I put the first ( in place VB opens up this info box listing all my collection elements and their


adding a collection to an arraylist collection -
for instance, i have a people class and a people collection. i would like to create a phone collection which consists of phone class and phone collection and then attach this to the people class object. so, in effect, i can call each people item and have the phone collection


Clear Collection items ...., -
Hai , I have a new collection RowE , i keep adding values to the collection and perform some string comparision, addition or whatever with them all, Now when i unload the form i need to clear all the contents in the collection . That is i want, RowE.Count shld be = 0. How can


Deleting Duplicates from a collection -
Does anyone have any idea how to delete duplicates from a collection. Or even better a way to check to see if the string exists in the collection before adding it. I have been through all the threads on collections and none seem to explain this problem. Thanks


Edit/Display/Deleting from a Collection -
Class/collection newbie questions for a homework assignment. Here we go: 1 form (textboxes to accept data and add, edit, display data in the collection) clsMotor (with defined properties for the class) clsMotors (collection that contains methods for saving, deleting, editing, disp


Collections question (newbie) -
I have a collection call colors. I have about 15 color elements in this collection. When I'm adding colors to the collection is there away to see if one of them already exist. For example lets say element #3 is blue, but at 16 the user wants to add blue again, how could I test to


Serialize a collection -
Hello, I have succeeded in serializing a class of purely public strings to an XML file for use as my app. settings as a replacement for an .ini file. (Largely due to reading this forum!) I would now like to serialize a collection of strings (for example a list of user names) usi


Key for items in a Collection -
Hi, I have a problem. Removing an item from a collection, and then adding a new object with a Key like the one of the deleted item, I get a message "This key is already associated with an element in this collection (error 457)". What can I do to be able to reuse the dele


collections help please!!! -
What exactly does a collection do? if i set a new collection in my form will i be about to use the collection in other forms? what is a collection of classes are there?? can only show me basics of a collection with examples add , remove , items etc keywords? understanding is m


Comparing info in a Collection -
I am currently using a collection to store data about products. I want to compare fields in 2 different collection items, and then sort by which has the greatest number in the collection item that is being compared. For example I have: Collection Item 1 has a field names matches


Collection or Array for speed -
I have a class called stock that holds last_price, symbol, high, and low (for now). I have a collection of stock named stocks that is index by symbol. The collection stocks contains app. 1300 instances of obj stock. I have an event that triggers when the last price on any of t


Collection in dll be accessable from other dll. -
Ok, here is what I need. I need to have a dll that will hold a collection of connected sockets. A third party dll needs access to this collection. I have tried this many times before, but whenever I try to access the collection which I tried making static, the thrid party dll just gets


Highlighted items in multi select -
Hello, I am working with a list box that has multiple selct turned on, and all that I want to know is, is there a way to get all of the highlighted indexes in an array or a collection or something. I realize that it you could do it by trapping every click event and adding or removing a


UserControl property question -
I have an usercontrol with a collection of items, i can use the Forms Editor for Adding/Remove and Editing the items in the collection at design time (thanks at this forum for this). Now i want to have a property ID wich is one of this items, and select it at design time. I'm exp


[2005] Node Collection AddRange Method -
Anyone know if the AddRange Method for adding a collection of nodes works only on the Parent nodes? Or can I add a collection that contains Parent, Child, and "Grandchild" nodes all at the same time? Thanks


Collections, classes and New() -
I have a "master" collection and a temporary collection, each is based on a class that I defined. The "master" collection exists as a private form variable. The temporary collection exists in a sub on that form. In the sub I set my temporary collection equal to t


How to get values from session objects -
I ahve a collection object saved in the session I have also declared a new collection object When I do the following(written from memory ) dim newcoll as new collection newcoll = Cast(Session("Collection"), Collection) I get only a reference to the session colle


Struggle with collections -
Is it possible to know on what index you are in your collection? I work with VB6 but because I'm a straight object oriëntated [Edited by MartinLiss]I work with classes (yeah right). So I've got a collection of this class. Problem is on a certain moment I want to change the data of one


Garbage Collection in VB -
Do you have to do garbage collection in VB like you do in C? Or does VB do automatic garbage collection like Java? If I must free up the memory used by VB, what are the commands? I did a search for garbage collection in MSDN and got nothing related to VB. I am assuming some G


ItemExist in Collection [Resloved] -
Hi, Is there any way i can check if an Item in a Collection object already exist before adding it. Say i have a collection called MyColl i added an item MyColl.add myobj, "key1" now is there way i can find out if an item with the "key1" key name already


return a collection from a fucntion -
Hi I have a command button when clikced goes to a class module function, which get a collection of all mails in my Inbox. I need to return the collectoin to myform and be able to access the collection. How do i do it????? When i do the processin in same Sub it works fine. But when


Accessing the "Key" values in a VB Collection -
I'm new to Visual Basic. I've been trying to implement an associative array (indexed like: key -> value), and I'm using a Collection. It seems to work just fine in terms of adding values and accessing them by their key, but I can't seem to get at the keys themselves. In pseudocode,


Fastest way to do this -
Hey, i'm looking for the best/fastest way to accomplish this: Here is the scenario 1. have database of 60,000 records 2. i run search and query returns around 6000 records 3. code runs through them and does ranking 4. i only want top 500 records to be inserted into DB. the


Labels collection... -
I have a prob which may be able to be solved by a collection... Can someone give me quick runthrough on how I could create a collection of labels, and set their properties. I would like to reference them by an Index, not a Key. (I'm using a collection 'cause I want the Remove me


Creating a collection -
Hi. I have a small problem about creating a collection. I sure know how to loop through all controls of a collection (for each ctl in form.controls). The problem is I would like to CREATE such a collection myself. (Ex.: I will add to a collection all the textboxes that the user have


Structuring my DB class objects. -
I am trying to get to a point where we don’t have to do any SQL/Database coding. So far I have four classes, Connection, Lookup, Customers and Customer. The Connection handles the connection and holds the Username, Password and Server properties. The Lookup handles the SQL for r


Adding to collection question -
Hi there, I've spent all day trying to get this code to work, I'm pleased to say that I'm nearly there, I think ! The code below works fine, it adds everything to the collection so there is no problems here. Although I have another form which supposedly allows you to add a new cate


For Loop.. HELP!!!! -
Hi, VB Created this function for me.. Public Property Get NewEnum() As IUnknown 'this property allows you to enumerate 'this collection with the For...Each syntax Set NewEnum = mCol.[_NewEnum] End Property i dont know what IUnknown is but it compiles fine.. W


Checking for instance of string in collection -
Hello folks, I'm looking to make my own duplicates remover whichout using others available and am using a collection for this, as a collection I beleive can only hold one of the same item once, if there any method available that can check the current collection for a item already house


Transferring contents of server collection to local collection -
Hello folks, I have an ASP page which uses a server based dll to instantiate a collection which is used to poulate a list box. The collection is two columns and I want to use the second column to populate a text box based on the row in the listbox which is selected. I am not an A


Advanced collection -
Can anyone tell if this is possible in VB6? I have an object structure like this. Rootobject --companycollection ----company ------contactcollection --------contact But now I want to make another collection that points directly into the existing contact collection. Rootob


Collection v/s Datatables -
What is better in terms of performance and resource-use, a Collection or a DataTable? What are the different situations in which a Collection will work better than a DataTable, and vice versa? What would be the ideal method for replacing a Collection in code with a DataTable?


Passing VB.net collection to VB6 com dll -
Hi, I have a VB6 COM DLL that expects a VB6 style collection object as parameter to a method. It seems like I can not pass a VB.NET created collection. What do I have to do? I can not make any modifications to the VB6 COM DLL. The VB6 DLL accesses items in the collection by a


Loading collection from file -
I have created a student collection, attached below, to add student information to a file. What I cannot figure out is how to modify the collection so it saves the collection in a file or database before the program exits. When it starts up, it needs to load the collection from that f


Collections help please -
adding collections. i have added a collection to my project in a class module but i get errors when trying to run it what am i doing wrong help me please??? Code: Private colDetails As New collection 'then using a function colDetails.add newDetail, CStr(.id) 'and i get a


How to get Unique List from a Collection -
Hi I have a collection in vb which has collection of strings. Is there any easy way to get unique list from the collection or do we have any thing similar to collection that gives us unique list easily. We have HashSet in java which gives us unique collection.So do we have any


Recordset to Collection -
I have tried taking the records from a recordset and building a collection. Problem is that I close the recordset afterwards. When trying to access items in the collection, they are invalid (because the RS is closed). How can I transfer the values of the RS rather than create poin


Adding ADO records to collection -
I'm trying to do one of two things. I'm working with a recordset returned by a SQL stored procedure, and as I apply my complex criteria in the next step, I want to store the records I want to keep in a collection. My problem is that I cannot seem to say : adoRecord.open adoRecSet


enumerate collection in RichTextBox -
How do I print the items in my collection in a RichTextBox. If I try to show the items in my collection in debug.print, all the items in my collection show. So I know I have the enumeration part set up correctly. If I try to use the same process in the RichTextBox, it loops through


Collection class with a collection class within -
An example might be I have: Class Employees - Stores collection all Employees Class Employee - Stores individual employee data, and stores a collection of their children Class Child - Stores individual Child Data I understand the simple Employees, and Employee class, but the ad