Solved

Problem with COM+ component

Posted on 2001-08-21
8
212 Views
Last Modified: 2008-03-17
I am writing my first COM+ component, to provide authentication on our intranet. The following code produces an "Automation error - library not registered":

Public Function IsAuthenticated() As Boolean

   Dim objContext As ObjectContext
   Dim objRequest As Request

   Set objContext = GetObjectContext()
   Set objRequest = objContext.Item("Request")

   ...

   objContext.SetComplete
End Function

at the "Set objRequest" line. I've included the COM+ Services Type Library and the Active Server Pages Object Library in the Project|References...

Any idea what's wrong?
0
Comment
Question by:CtrlAltDel
8 Comments
 
LVL 1

Expert Comment

by:Madmarlin
Comment Utility
Not 100% sure but I have a feeling that it may be related to the binding.

At present you using early binding which may mean that your types are not recognised.

Try using late binding and see if you get the same error..

If you need examples let me know and I'll try and knock something up..


Madmarlin
0
 
LVL 7

Expert Comment

by:Z_Beeblebrox
Comment Utility
Are you running this in the VB IDE? Unless you configure it very carefully, VB will return nothing for GetObjectContext because it is not running in COM+ so has no context. If you are developping on a Windows 2000 machine, it is possible to debug a component under COM+, and so get the context, but I don't remember where I found the article that explained this. Anyways, try placing a msgbox before and after that line, compiling it, and then running it under com+.

Zaphod.
0
 
LVL 1

Author Comment

by:CtrlAltDel
Comment Utility
>Beeblebrox - yup it's running in the IDE. I added in a MsgBox before the problem line, and that pops up no problem. It still goes on then to fail at the usual place with the same error as before.

The annoying bit is I'm following the code samples in an O'Reilly book (Developing ASP Components) and it *still* doesn't work.

I feel an increase in points awarded coming on...
0
 
LVL 1

Author Comment

by:CtrlAltDel
Comment Utility
OK, solution found here

http://www.vb2themax.com/HtmlDoc.asp?Table=Articles&ID=280

The short version is that the component was registered with Component Services, which conflicts with the VB IDE. Unregistering the component fixed the problem.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 1

Author Comment

by:CtrlAltDel
Comment Utility
How annoying... many thanks for suggestions though.
0
 
LVL 7

Expert Comment

by:Z_Beeblebrox
Comment Utility
Hi, no problem. You should ask Customer Service to reduce the points of this question to 0 and the PAQ it so other people can find it.

Zaphod.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi CtrlAltDel,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

CtrlAltDel, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
Comment Utility
Per recommendation, points refunded and question closed.

Netminder
CS Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now