Passing back collection from VB Component

Results 1 to 2 of 2

Thread: Passing back collection from VB Component

  1. #1
    JEB Guest

    Default Passing back collection from VB Component

    Hi<BR> I&#039m trying to write a VB component to simplify and speed up my ASP app. The problem is trying to find the right trade off between speed and clarity of code. The structure of the results is such that I have nested info :<BR>eg.<BR>.FirstName<BR>.Surname<BR>.items<BR>.. items1<BR>..items2<BR>..itemsn<BR>.sets<BR>..set1< BR>...itemset1<BR>...itemset2<BR>..set2<BR>.....et c<BR>This doesn&#039t lend itself to strings.. unless I have complex functions to try and process the returned string.. An option I&#039d prefer to avoid. I keep reading about issues such as stateless components, marshalling, disconnected recordsets, ... all of which make me want to return one big dataset rather than multiple requests to the object.<BR><BR> Any suggestions .. ideas ?<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    22

    Default RE: Passing back collection from VB Component

    if you want to pass back a collection from vb this must be in your in a vb activex dll<BR>Public Function GetNewCollection() As Variant<BR> Set GetNewCollection = New Collection<BR>End Function<BR>and in your asp you need this<BR><BR>dim dllName<BR>set dllName = Server.CreateObject("Dll.DllClass")<BR><BR>dim collection<BR>set collection = billing.GetNewCollection()<BR><BR>then you should be able to pass the collection to a vb function<BR>byref as a variant<BR><BR>or you could use the dictionary object within asp which is a godsend!!! and in your vb dll you just include a reference to microsoft scripting runtime and you can use the dictonary object too, just pass it byref as variant

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •