Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: Cannot create ActiveX component

Status
Not open for further replies.

jmeckley

Programmer
Jul 15, 2002
5,269
US
I am getting the above error when I execute the following code:[tt]
Imports ActiveDs
----------------
Dim Cnn As New SqlConnection(Connect)
Dim CmdEmail As New SqlCommand()
Dim RdrEmail As SqlDataReader
Dim adUser As IADsUser
Dim Email As New ArrayList()

With CmdEmail
.CommandType = CommandType.StoredProcedure
.CommandText = "sp_ActiveDirectory_s"
.CommandTimeout = 99
.Connection = Cnn
End With
RdrEmail = CmdEmail.ExecuteReader
While RdrEmail.Read
adUser = GetObject(RdrEmail.Item("ADsPath").GetType.ToString())
Email.Add(adUser.EmailAddress)
End While
[/tt]
Any ideas why? The IADsUser type is used to access Active Directory. I had to add the COM object: Active Directory Library Type to get it.

Jason Meckley
Database Analyst
WITF
 
the error is:
Code:
Cannot create ActiveX component
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Exception: Cannot create ActiveX component.

Source Error: 


Line 66:             RdrEmail = CmdEmail.ExecuteReader
Line 67:             While RdrEmail.Read
Line 68:                 adUser = GetObject(RdrEmail.Item("ADsPath").GetType.ToString())
Line 69:                 'If adUser.AccountDisabled = False And adUser.Groups.GetEnumerator = "All Staff" Then
Line 70:                 Email.Add(adUser.EmailAddress)
 

Source File: c:\inetpub\[URL unfurl="true"]wwwroot\DubRequest\DubRequest.aspx.vb[/URL]    Line: 68 

Stack Trace: 


[Exception: Cannot create ActiveX component.]
   Microsoft.VisualBasic.Interaction.GetObject(String PathName, String Class)
   DubRequest.Request.Page_Load(Object sender, EventArgs e) in c:\inetpub\[URL unfurl="true"]wwwroot\DubRequest\DubRequest.aspx.vb:68[/URL]
   System.Web.UI.Control.OnLoad(EventArgs e)
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Page.ProcessRequestMain()


Jason Meckley
Database Analyst
WITF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top