Solved

VB, Com+ and Iobjectconstruct

Posted on 2000-02-16
1
403 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses
Course of the Month6 days, 11 hours left to enroll

634 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