473,395 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

pass collection from vb to asp

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
Jul 19 '05 #1
4 1681
It seems that the collection would be a member of your object.

For Each Thing In yourObject.CollectionClass
Response.Write Thing.Someproperty
Next

--

Ray at home
Microsoft ASP MVP
"Wandy Tang" <wa********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP09.phx.gbl...
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

Jul 19 '05 #2
Dear All,

Can show the exact source, sorry I am kind of stupid here
Many Thanks

Regards
Wandy Tang
Jul 19 '05 #3
Not without knowing the object model of your component!

Here's an example with a commonly known component.
<%
Dim oFSO, oFolder, oCollectionOfSubfolders, ItemInThisCollection
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFOlder = oFSO.GetFolder("C:\inetpub\wwwroot")
Set oCollectionOfSubfolders = oFolder.Subfolders
For Each ItemInThisCollection in oCollectionOfSubfolders
Response.Write ItemInThisCollection.name & "<br>"
Next
Set oFolder = Nothing
Set oFSO = Nothing
%>
Ray at work

"W.Tang" <an*******@discussions.microsoft.com> wrote in message
news:4A**********************************@microsof t.com...
Dear All,

Can show the exact source, sorry I am kind of stupid here.
Many Thanks.

Regards,
Wandy Tang

Jul 19 '05 #4
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/de...ctionClass.asp

Chris.

"Wandy Tang" <wa********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP09.phx.gbl...
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

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andrés Giraldo | last post by:
Hi! I'm trying to pass trough all the objects of a form but I have some text inputs in a DIV and I have many DIVs like this on my form. I'm doing something like: for (i = 0; i <...
5
by: Mark Dicken | last post by:
Hi All, I am trying to Pass A Collection To A FUNCTION ??? (Access 2000) I have a Class called BO (for Business Objects) Within BO I have a Function called ShowCollection Public Sub...
1
by: Mark Dicken | last post by:
Hi All I have found the following Microsoft Technet 'Q' Article :- Q210368 -ACC2000: How to Pass an Array as an Argument to a Procedure (I've also copied and pasted the whole contents into...
4
by: deko | last post by:
This is a basic program flow question. I'm trying to refractor an AC2000 app and split sections of code into separate modules. But there are a number of collections I create in one big module -...
1
by: Sam | last post by:
Hi, I write my code behind in C# and everytime I need a new functionality, I build a class for it and save it in a folder I call ClassLibrary. My question is I don't know how to send my web...
1
by: Josema | last post by:
Hi to all, i have a class (of type collectionbase) that creates a collection of objects for instance persons. For other hand i have a Datagrid whose Datasource its the collection wich i...
15
by: Prachi Dimble | last post by:
Hi, In vb.Net one can pass arguments to properties. How does one achieve it in c#? Given below is the vb.net code for passing arguments to property getters and setters.. Thanks, Prachi ...
4
by: Alexander Kolev | last post by:
I have a huge struct with many members.I don't want to copy this struct to the stack, that's why i pass it by reference to a function. But also i want the function to be unable to modify it....
6
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.