A collection is an object in its own right and as such can be passed back to
ASP as the return form a function.
In the ASP there is no method of declaring a variable to be a collection
unless you use a collection class to wrap the collection object in something
that can be instantiated so generally speaking you won't have any
intellisense for the collection object so you have to call the methods and
properties 'blind'.
eg. VB:
[In myobject class of mydll COM component]
Function GetCollection() as Collection
Set GetCollection = New Collection
End Function
In ASP:
Dim pobjObject
Dim pcolCollection
Set pobjObject = Server.CreateObject("mydll.myobject")
Set pcolCollection = pobjObject.GetCollection()
With pcolCollection
Response.Write "There are " & pcolCollection.Count & " objects in the
collection."
End With
Set pcolCollection = Nothing
Set pobjObject = Nothing
Collection Classes
http://msdn.microsoft.com/library/d.../html/vaconCreatingYourOwnCollectionClass.asp
Chris.
Dear All,
How to pass a collection from a VB Component to an ASP page? I have no clue
the syntax of all.
Many Thanks.
Regards,
Wandy Tang