Discussion Locked

Creating VB class objects in ASP page?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi!

I have a VB Class. I create objects of that class in a COM Component, put all the objects in a array
and put the array in session... ok

Now, in the ASP page, I get the array from session. This array contains objects of the VB classes!
Now, unless I can create objects of the VB class in ASP, I cant work on the classes objects in the array!
SO, how will I create objects of a VB class in ASP?

Thanks
Rajiv.

5 replies

by txitguy

I'm not entirely sure what you are trying to do with the array and the session, but it sounds terribly inefficient at best. rcaluste has given at least part of the answer, the syntax for creating an object in an ASP page is

Set objMyClass = Server.CreateObject("ProjectName.ClassModuleName")

In order for this to work though, you have to compile the class into a COM DLL. Copy the DLL into a directory on the server (C:\winnt\system32\ works well), and run regsvr32 on it. For example:

regsvr32 c:\winnt\system32\myclass.dll

Ben

This discussion is closed to new replies.