Link to home
Start Free TrialLog in
Avatar of ccleebelt
ccleebeltFlag for United States of America

asked on

Proper way to build a VB COM object

EE-

I typically use ASP to script all my sites, but need to move some code to VB COM but I am uncertain as to the best way to start my VB project.

Here are the items I will need to use.

Call stored procedure (ADODB.COMMAND)
Return recordsets (ADODB.RECORDSET)
Data Connections (ADODB.CONNECTION)

I will also need to reference objects such as Jmail to send emails from the object.

My question is

a) What is the best way to start to build the object
b) How do I make the object perform optimally (multithreading?)
3) If I reference 3rd party objects in my object, do they need to be installed on the box that runs my object after I compile with the reference?
4) How do I return recordsets from COM?

Any other helpful hints would be appreciated.  I am basically rewriting ASP code in COM for performance issues.

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mirghani
mirghani

hi,
from my point of view u start with ur Standard EXE VB Project and start adding ur Classes and when u want to use a method in certain class do the following:
Dim MyCls as MyProj.ComCls
Set MyCls=New MyProj.ComCls
then u can call: MyCls.DoAnyThing
after building a proper classes without bugs u could choose ur new ActiveX Dll and Past the Code over there.
when u want to compile Remeber to check the Remote Server Files CheckBox as to Produce TLB and VBR files on compiling then ur Files could be Exported to the Clients.
Regards.
Meer.
keep in mind to implement the COM Concept as follows:
Client--->BuisnissObject--->DataObject--->DataAccess--->Backend.
Regards.
Meer.
Avatar of ccleebelt

ASKER

This does not answer the question at all.

acperkins - can you please expand on your recordset movenext idea?
Sure.  Once you have identified the properties you want to expose, then create a MoveNext method in your ActiveX DLL.
This will execute the MoveNext method in your recordset and populate the properties (actually there internal variables).  As I mentioned before this will avoid you having to instantiate a recordset in your ASP.

I realize I have painted a broad picture, but that is because I am not familiar with the details of your project, so I have deliberately been general.

Anthony
sorry it took so long to close.