Help - Search - Members - Calendar
Full Version: ADODB.Connection issues
The CD Forum > Bart's PE Builder > Troubleshooting
jahncm
I have several VBScripts that I am wanting to run that use the CreateObject("ADODB.Connection") method, but I am always getting this error:

ActiveX Component can't create object: 'ADODB.Connection'

I have tried several ADO, WSH and VBScript plugins, but nothing seems to work.
As long as as I don't use an CreateObject("ADODB. uname it) the scripts will work, unfortunately I need to be able to use these critical ADODB objects.

Can someone direct me to a plugin that should work for these CreateObject calls?

Here is just one script that I am using:

Option Explicit

WScript.Echo "Computer Account in AD: " & _
isComputerAccountExists("COMPUTERNAME")
' explicit hostname set

Function isComputerAccountExists(host)
Dim conn, cmd , rs

Set conn = CreateObject("ADODB.Connection")
Set cmd = CreateObject("ADODB.Command")

conn.provider = "adsdsoobject"
conn.open "active directory provider", "DOMAIN\USERNAME", "password"
cmd.activeconnection = conn
cmd.commandtext = "<LDAP://DOMAINCONTROLLER/dc=domain,dc=com>;" & _
"(&(objectcategory=computer)(objectclass=computer)(cn=" & host & "));cn;subtree"

Set rs = cmd.Execute

If rs.recordcount = 0 Then
isComputerAccountExists = False
Else
isComputerAccountExists = True
End If

Set rs = Nothing
Set cmd = Nothing
Set conn = Nothing
End Function
jahncm
Nevermind. I'm an ID10t.

I had posted this before and had just forgotten to initialize the mdac-installer.

ugh
Joshua
QUOTE (jahncm @ Apr 13 2007, 02:58 AM) *
I had posted this before and had just forgotten to initialize the mdac-installer.

laugh.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.