GetObject error: 'Cannot create ActiveX component'

GetObject error: 'Cannot create ActiveX component'

Post by Hank » Fri, 30 May 2003 22:35:40



This code is failing for me using vb.net:

Imports ADSSECURITYLib
Imports System.Diagnostics
Imports Scripting
Imports ActiveDs

Dim dlobj As IADsGroup

dlobj = GetObject("LDAP://system.edu/CN=test list,CN=Users,DC=system,DC=edu")

the above line gives 'Cannot create ActiveX component.'

I am hoping to get the list and manage it using vb.net

HankC

 
 
 

GetObject error: 'Cannot create ActiveX component'

Post by Richard Mueller [MVP » Fri, 30 May 2003 22:38:02


Hi,

You need to use the Set statement to reference an object, as below:

Quote:> This code is failing for me using vb.net:

> Imports ADSSECURITYLib
> Imports System.Diagnostics
> Imports Scripting
> Imports ActiveDs

> Dim dlobj As IADsGroup

> dlobj = GetObject("LDAP://system.edu/CN=test

list,CN=Users,DC=system,DC=edu")

Set dlobj = GetObject("LDAP://system.edu/CN=test
list,CN=Users,DC=system,DC=edu")

Quote:

> the above line gives 'Cannot create ActiveX component.'

> I am hoping to get the list and manage it using vb.net

> HankC

--
Richard
Microsoft MVP Scripting and ADSI
http://www.rlmueller.net
--

 
 
 

GetObject error: 'Cannot create ActiveX component'

Post by Hank » Sat, 31 May 2003 01:46:10



Quote:> Hi,

> You need to use the Set statement to reference an object, as below:

the 'set' statement is removed for me by the vb.net code developer window...

HankC

Quote:

> > This code is failing for me using vb.net:

> > Imports ADSSECURITYLib
> > Imports System.Diagnostics
> > Imports Scripting
> > Imports ActiveDs

> > Dim dlobj As IADsGroup

> > dlobj = GetObject("LDAP://system.edu/CN=test
> list,CN=Users,DC=system,DC=edu")

> Set dlobj = GetObject("LDAP://system.edu/CN=test
> list,CN=Users,DC=system,DC=edu")

> > the above line gives 'Cannot create ActiveX component.'

> > I am hoping to get the list and manage it using vb.net

> > HankC

 
 
 

GetObject error: 'Cannot create ActiveX component'

Post by Carlos Magalhae » Sat, 31 May 2003 03:26:58


Hank You do not need to need to use set as the SET command was removed
from the coding vocab in vb.net.

Have you got the ADSSECURITYLib.dll and ActiveDs.dll added as a
referance in your vb.net project.

Usually this error message is either when the application that is
trying to invoke the ADSI COM component can not find the correct dll's
or functions that it needs to enitalize the component.

Check to see if you have the referances added in your project
referances.

Also what version of the  ADSSECURITYLib.dll and ActiveDs.dll are you
running?



>> Hi,

>> You need to use the Set statement to reference an object, as below:

>the 'set' statement is removed for me by the vb.net code developer window...

>HankC

>> > This code is failing for me using vb.net:

>> > Imports ADSSECURITYLib
>> > Imports System.Diagnostics
>> > Imports Scripting
>> > Imports ActiveDs

>> > Dim dlobj As IADsGroup

>> > dlobj = GetObject("LDAP://system.edu/CN=test
>> list,CN=Users,DC=system,DC=edu")

>> Set dlobj = GetObject("LDAP://system.edu/CN=test
>> list,CN=Users,DC=system,DC=edu")

>> > the above line gives 'Cannot create ActiveX component.'

>> > I am hoping to get the list and manage it using vb.net

>> > HankC

 
 
 

GetObject error: 'Cannot create ActiveX component'

Post by MVP - ADS » Sat, 31 May 2003 04:21:45


I recommend you not use the old GetObject syntax in VB.NET and switch to
using the managed classes for accessing AD in the System.DirectoryServices
namespace.  A full tutorial is available here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netd...

Joe K.



Quote:> > Hi,

> > You need to use the Set statement to reference an object, as below:

> the 'set' statement is removed for me by the vb.net code developer
window...

> HankC

> > > This code is failing for me using vb.net:

> > > Imports ADSSECURITYLib
> > > Imports System.Diagnostics
> > > Imports Scripting
> > > Imports ActiveDs

> > > Dim dlobj As IADsGroup

> > > dlobj = GetObject("LDAP://system.edu/CN=test
> > list,CN=Users,DC=system,DC=edu")

> > Set dlobj = GetObject("LDAP://system.edu/CN=test
> > list,CN=Users,DC=system,DC=edu")

> > > the above line gives 'Cannot create ActiveX component.'

> > > I am hoping to get the list and manage it using vb.net

> > > HankC

 
 
 

GetObject error: 'Cannot create ActiveX component'

Post by Hank » Sat, 31 May 2003 06:16:37



> Have you got the ADSSECURITYLib.dll and ActiveDs.dll added as a
> referance in your vb.net project.

I do have the references... they both say version 1.0

Quote:

> Usually this error message is either when the application that is
> trying to invoke the ADSI COM component can not find the correct dll's
> or functions that it needs to enitalize the component.

> Check to see if you have the referances added in your project
> referances.

> Also what version of the  ADSSECURITYLib.dll and ActiveDs.dll are you
> running?

activeds.dll is 5.1.2600.0 in the system32 directory and
Interop.ActiveDs.dll is version 1.0

HankC



> >> Hi,

> >> You need to use the Set statement to reference an object, as below:

> >the 'set' statement is removed for me by the vb.net code developer window...

> >HankC

> >> > This code is failing for me using vb.net:

> >> > Imports ADSSECURITYLib
> >> > Imports System.Diagnostics
> >> > Imports Scripting
> >> > Imports ActiveDs

> >> > Dim dlobj As IADsGroup

> >> > dlobj = GetObject("LDAP://system.edu/CN=test
> >> list,CN=Users,DC=system,DC=edu")

> >> Set dlobj = GetObject("LDAP://system.edu/CN=test
> >> list,CN=Users,DC=system,DC=edu")

> >> > the above line gives 'Cannot create ActiveX component.'

> >> > I am hoping to get the list and manage it using vb.net

> >> > HankC

 
 
 

GetObject error: 'Cannot create ActiveX component'

Post by Hank » Thu, 05 Jun 2003 00:30:19



Thanks that gave me a great leap forward. Now, given this object, I
receive a catastrophic error retrieving it's security principal:

        Dim sec As New ADsSecurity()
        Dim sd As New SecurityDescriptor()

        sec = CreateObject("ADsSecurity")      

        Dim dlobj As New DirectoryEntry(dlName) 'success to here

        sd = sec.GetSecurityDescriptor(dlobj)   'failure

I've not yet found samples using adssecurity in vb.net ...

TIA,
HankC

> I recommend you not use the old GetObject syntax in VB.NET and switch to
> using the managed classes for accessing AD in the System.DirectoryServices
> namespace.  A full tutorial is available here:

> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netd...

> Joe K.





> > > Hi,

> > > You need to use the Set statement to reference an object, as below:

> > the 'set' statement is removed for me by the vb.net code developer
>  window...

> > HankC

> > > > This code is failing for me using vb.net:

> > > > Imports ADSSECURITYLib
> > > > Imports System.Diagnostics
> > > > Imports Scripting
> > > > Imports ActiveDs

> > > > Dim dlobj As IADsGroup

> > > > dlobj = GetObject("LDAP://system.edu/CN=test
> > > list,CN=Users,DC=system,DC=edu")

> > > Set dlobj = GetObject("LDAP://system.edu/CN=test
> > > list,CN=Users,DC=system,DC=edu")

> > > > the above line gives 'Cannot create ActiveX component.'

> > > > I am hoping to get the list and manage it using vb.net

> > > > HankC

 
 
 

1. ActiveX-Component can't build object: 'ADODB.Command'

I wrote a VisualBasicScript, which shows all name and phonenumber of users.
As vbs-File, it works fine. I want to implement it into XML-Page. When I
want run it with Internet-Explorer, a error come up:

Line:         57
Character:    2
Fault:      "ActiveX-Component can't build object: 'ADODB.Command'
Code:       0

What is wrong here?

Thanx a lot!

cu Floh;)

My SML-SourceCode:

<package>
<reference object="ActiveDs.ADSystemInfo"/>
<reference object="ActiveDs.WinNTSystemInfo"/>
<reference object="ActiveDs.IADsContainer"/>
<reference object="ActiveDs.IADsUser"/>
<Job id="CreateContactWithADSI">
<script language="VBScript">

Option Explicit

Dim Con, ocommand 'ADO-Connection
Dim root, sDomain, sADsPath 'root, Domain & Pfad fr Active Diretory
Dim sFilter, sAttribsToReturn, sDepth 'Parameter fr die Suche
Dim rs 'unsortierte Suchergebnis
Dim strText 'String
Dim dLastLogin 'Letzte Login
Dim Domain, User 'LPAD
Dim i, j, x 'Z?hler
Dim DebugVar 'Debugvariable
ReDim FullName(4), TelephoneNumber(4), LastLogin(4) 'Array fr Ergebnis

Const FEHLERBEHANDLUNG = FALSE

If FEHLERBEHANDLUNG = TRUE Then
 On Error Resume Next
End If

'Create ADO connection object for Active Directory
 Set Con = CreateObject("ADODB.Connection")
 If (Err.Number <> 0) Then
  BailOnFailure Err.Number, "on CreateObject"
 End If

 Con.Provider = "ADsDSOObject"
 If (Err.Number <> 0) Then
  BailOnFailure Err.Number, "on Provider"
 End If

 Con.Open "Active Directory Provider"
 If (Err.Number <> 0) Then
  BailOnFailure Err.Number, "on Open"
 End If

'Create ADO command object for the connection.
 Set ocommand = CreateObject("ADODB.Command")    '<--- That ist line 57
 If (Err.Number <> 0) Then
  BailOnFailure Err.Number, "on CreateObject"
 End If

        .
        .
        .

</script>
</Job>
</package>

2. My hellish DiretX experience: "directdraw init failed"

3. ActiveX Component cann't create object

4. Got a good one for ya

5. Console error, activeX ,can't create, 800a01ad

6. Developer/2000 Documentation - NOT.

7. 'Manage Electronic Mail' makes ActiveX errors!

8. Problem with //E Duodisk

9. Help with Permission Error 'GetObject'

10. Error '8007001f' for code GetObject"LDAP://rootDSE")

11. What's with 'Can't create or use IPC area'?

12. I got a problem:Permission denied: 'GetObject'

13. HELP : AdsSecurity.Dll And Error : -2147023591 (Method '~' of object '~' failed)