Problem with adding a connection with Win32::NetResource



Hi all,
I'm new to Perl and I'm trying to use it to connect to a shared disc
through a home network. This is what I've tried:
--------------------------------------------------------------------------------------------------------------------
#!/usr/bin/perl -w
use Win32::NetResource;
$RemoteShare = {
'LocalName' => "X:",
'RemoteName' => "\\\\Nash",
};
$UserName = "No Name";
$Password = "";
$Connection = 1;
Win32::NetResource::AddConnection($RemoteShare,$Password,$UserName,
$Connection)
or print "unable to add Nash\n";

Win32::NetResource::GetError( $ErrorCode );
print "Error code is $ErrorCode";
-----------------------------------------------------------------------------------------------------------------------
The program actually works if I omit the 'LocalName' definition in
line 4, i.e. it makes the connection. However, since I don't have a
local name I can't subseqently cancel the connection, and I'd like to
be able to do that.
With the local name definition, the program doesn't make the
connection, reporting an error code of 1200.

So:
1. What am I doing wrong?
2. Where can I find the error codes and their meanings?

TIA,
Nash

.



Relevant Pages

  • Re: OWA, Remote Web Workspace problem
    ... published site. ... article form ISAServer.org in the "Verify External Connectivity" section ... Other requests will be answered with the error message: Error Code: 403 ... A successful connection attempt will probably provide with the following ...
    (microsoft.public.isaserver)
  • Re: Winsock provider catalog
    ... PING: transmit failed, error code 65. ... info Using home Internet connection ... info Network connection: Name=Local Area Connection 3, ...
    (microsoft.public.windowsxp.general)
  • Re: Winsock provider catalog
    ... PING: transmit failed, error code 65. ... info Using home Internet connection ... info Network connection: Name=Local Area Connection 3, ...
    (microsoft.public.windowsxp.general)
  • Re: activesync code 0x85020006
    ... The error code you mention below maps to a connection error - ... Internet Explorer? ... installing ActiveSync 4.2, ...
    (microsoft.public.pocketpc.activesync)
  • The AcquireConnection failed with error code 0xC0202009. sql<->sql
    ... The AcquireConnection method call to the connection manager "XYZ" failed ... component "OLE DB Source" failed validation and returned error code ... The job runs under sql server agent account. ... encrypted and was migrated between 2 environment without an issue. ...
    (microsoft.public.sqlserver.dts)