Title: Question about Win32-OLE

It is not clear that the Connect() call failed.  Is it defined to return a true value if it succeeds?  Your _vbscript_ code is not checking the return code of Connect() at all.

 

If the connection is indeed failing, then you should try to print out Win32::OLE->LastError as part of your error message to see what is going on.

 

Cheers,

-Jan

 

PS: Please use plain text for mailing list messages.  Thanks!

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: May 24, 2006 11:59 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: Question about Win32-OLE

 

Hi all,

I am having a problem accessing a commercial SFTP server app (non-MS). My code is below. I can instantiate the object but the connect method refuses to establish the connection.

use Win32::OLE;
my $Server = "localhost";
my $Port =  "1000";
my $UserName = "Admin";
my $Password = "Admin";
my $SFTPServer = Win32::OLE->new("SFTPCOMInterface.CIServer");
$SFTPServer->connect( $Server, $Port, $UserName, $Password ) or die "Could not connect as $UserName to $Server:$Port!";

The above simple script throws this error:
Could not connect as Admin to localhost:1000! at C:\Source\SFTPTest.pl line 7.

I feel the parameters are being accepted because if I change $UserName or $Password, then I get a msg that logon failed.

These same parameters work in this VBS:
Set SFTPServer = WScript.CreateObject("SFTPCOMInterface.CIServer")
      txtServer = "localhost"
      txtPort = "1000"
      txtUserName = "Admin"
      txtPassword = "Admin"
SFTPServer.Connect txtServer, txtPort, txtUserName, txtPassword

Does anyone have a clue as to what might be going wrong? There seems to be an issue with OLE itself but this is beyond me.

Thanks again and best regards,
Sturdy

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to