[EMAIL PROTECTED] wrote:

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:
{snipped}

Open connection failed. Error: 0'. When I run the
[...]

I think '0' means there's no error string. I played with the snippet a
bit, using what little I think I know.

HTH

-- mike higgins

- - - - - - - - - - - - 8< - - - - - - - - - - -

    # 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

          # ----------- load ADO constants ------------
use Win32::OLE::Const ('Microsoft ActiveX Data Objects 2.5 Library');

Win32::OLE->Option( Warn => 3); #

# AD OLE DB Search variables and connection

my $iADDBStateOpen = 1;
my $oADConnection = Win32::OLE->CreateObject("ADODB.Connection");

  if (defined $oADConnection){
      print("ADODB Connection made ");

  $oADConnection->{Provider} = "ADsDSOObject";
        if (! $oADConnection->open()) {
            print("Open Connection successful ");
        }
        else {
            my $error =  Win32::OLE->LastError();
           print("Open Connection failed. Error: ", Win32::FormatMessage
$error );
        }
    }
    else {
        print("ADODB Connection failed ");
    }



_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to