Solved

VB, Com+ and Iobjectconstruct

Posted on 2000-02-16
1
392 Views
Last Modified: 2010-05-18
I can't get my vb program to implement Iobjectcontruct to pull a connection string from my COM+ services.

I followed what microsoft has to say:

Make sure your project has a reference to "COM+ 1.0 Services Type Library".


In your class module, beneath any Option statements, add the following line of code:
Implements IObjectConstruct

You may also add a private class-level variable to hold the string:
Private msConstructorString As String

In the scope list box in your code editor, where it reads "(General)", you should have a new item called IObjectConstruct. When you select it the IObjectConstruct_Construct function will be added to your class.

Add the following code to it so the function looks as follows:
Private Sub IObjectConstruct_Construct(ByVal pCtorObj As Object)
     msConstructorString = pCtorObj.ConstructString
End Sub
This retrieves the ConstructString and stores it in your private variable.



but it never hits the iobjectconstruct_construct sub routine.
Any suggestions?

Craig
0
Comment
Question by:cerdmann
[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
1 Comment
 

Accepted Solution

by:
jinglis earned 200 total points
ID: 2540625
Use createobject instead of the new operator
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

752 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