Hello,

Can someone please advise me on the correct syntax to
create a Collection object in ASP? I used the code below,
but it does not work.

set myCollection = Server.CreateObject("VBA.Collection")

Thanks in advance!

Jack

Re: CreateObject Syntax for a Collection Object by Bob

Bob
Thu Dec 04 07:45:54 CST 2003

Jack wrote:
> Hello,
>
> Can someone please advise me on the correct syntax to
> create a Collection object in ASP? I used the code below,
> but it does not work.
>
> set myCollection = Server.CreateObject("VBA.Collection")
>
> Thanks in advance!
>
> Jack

I do not think you will be able to create a Collection (although ... you
HAVE installed the VB runtime files on the server haven't you?).

Try a Dictionary object instead:
http://msdn.microsoft.com/library/en-us/script56/html/jsobjDictionary.asp

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Re: CreateObject Syntax for a Collection Object by Jack

Jack
Thu Dec 04 08:04:03 CST 2003

Thanks Bob,

I really would like to use a collection if I could. I'm
working on a rather large existing app and need to re-
order a collection received from a VB DLL. By creating a
new colletion, I can add the items in the correct order
and let that new collection be used downstream. It would
be the least disruptive way of doing it.

I did consider setting my new variable equal to the
collection I want to re-order. Then, I could remove all
the items in it and re-add them in the order in which I
want them to appear. But, that seems like a lot of work
unless there is no way to create a collection in ASP.

Jack



>-----Original Message-----
>Jack wrote:
>> Hello,
>>
>> Can someone please advise me on the correct syntax to
>> create a Collection object in ASP? I used the code
below,
>> but it does not work.
>>
>> set myCollection = Server.CreateObject("VBA.Collection")
>>
>> Thanks in advance!
>>
>> Jack
>
>I do not think you will be able to create a Collection
(although ... you
>HAVE installed the VB runtime files on the server haven't
you?).
>
>Try a Dictionary object instead:
>http://msdn.microsoft.com/library/en-
us/script56/html/jsobjDictionary.asp
>
>Bob Barrows
>
>--
>Microsoft MVP -- ASP/ASP.NET
>Please reply to the newsgroup. The email account listed
in my From
>header is my spam trap, so I don't check it very often.
You will get a
>quicker response by posting to the newsgroup.
>
>
>.
>