Solved

Proper way to build a VB COM object

Posted on 2002-05-25
6
134 Views
Last Modified: 2010-05-02
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!
0
Comment
Question by:ccleebelt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 100 total points
ID: 7034683
a) Start a new project and select AtiveX DLL
b) Don't even bother with VB6.
3) Yes.  JMail and any other third party objects will have to be registered on the same box in order to use them.
4) Rather than returning the recordset, expose properties that give you the values you wish to use in ASP.  Also, create a "MoveNext" method in your DLL that mimics the Recordset's MoveNext method.  This way you do not need to instantiate ADO in your ASP and you can use it for the sole purpose of displaying the results of your DLL.

Anthony
0
 

Expert Comment

by:mirghani
ID: 7035411
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.
0
 

Expert Comment

by:mirghani
ID: 7035415
keep in mind to implement the COM Concept as follows:
Client--->BuisnissObject--->DataObject--->DataAccess--->Backend.
Regards.
Meer.
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

Author Comment

by:ccleebelt
ID: 7035576
This does not answer the question at all.

acperkins - can you please expand on your recordset movenext idea?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7035589
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
0
 

Author Comment

by:ccleebelt
ID: 7320420
sorry it took so long to close.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question