Hi All,
I am having trouble connecting anonymously to Active Diretory through an ADODB
connection using OLE. I can run the connection but can't open it. Here is a
code snippet:
# environment variables
use Win32::OLE; # base functionality
use Win32::OLE::Variant; # support for OLE data types
use Win32::OLE::Const ('Active DS'); # load ADSI constants
use Win32::OLE::Const ('Active X Data Objects');# load ADO constants
# AD OLE DB Search variables and connection
my $iADDBStateOpen = 1;
if (my $oADConnection = Win32::OLE->CreateObject("ADODB.Connection") ) {
$Response->Write("ADODB Connection made ");
$oADConnection->{Provider} = "ADsDSOObject";
if ($oADConnection->open()) {
$Response->Write("Open Connection successful ");
}
else {
my $error = Win32::OLE->LastError();
$Response->Write("Open Connection failed. Error:
$error ");
}
}
else {
$Response->Write("ADODB Connection failed ");
}
I get 'ADODB Connection made Open connection failed. Error: 0'. When I run the
same script converted to the command prompt it has a problem with the Const
line for the ADO constants, I comment this out and it gives me authentication
failed.
I have also tried the 'Listing 6' code from
http://www.winnetmag.com/WindowsScripting/Article/ArticleID/5456/5456.html and
it gives me authentication failed as well.
Thanks in advance for any help,
martin
--
Martin Douglas
[EMAIL PROTECTED]
ITS Network Programmer
661-2111 x.81187
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs