Solved

WNetAddConnection2 - "The network path was not found"

Posted on 2001-08-23
12
3,365 Views
Last Modified: 2007-11-27
I'm trying to use a modem to RAS into a server and map a drive. The RasDial() connects and authenticates fine, but when I actually try to map a drive, it fails.

Here's what I'm doing once I connect:

   nrServer.dwType = RESOURCETYPE_ANY;
   nrServer.lpLocalName = L"Z:";
   nrServer.lpRemoteName = L"\\MyServer\MyPath";
   nrServer.lpProvider = L"";

   dwError = WNetAddConnection2(&nrServer,
                                L"MyPassword",
                                L"MyUserName", 0);

This fails with dwError = 0x35 - 'The network path was not found.'

It is on our corporate network and if I call WNetAddConnection2() from a machine with an ethernet connection, it maps fine...

I've heard that there may be a configuration on some networks where the password and user name need to be reversed in WNetAddConnection2() but when I try that & get an error about an incorrect password (duh...). If I leave the password and user out, I get the same 0x35 error.

Any advice?
0
Comment
Question by:Grailman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 1

Author Comment

by:Grailman
ID: 6420056
Actually the remote name was \\\\MyServer\\MyPath

MyBad ;-o
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6420058
I'm not where I can test this, but does it make any difference if you use RESOURCETYPE_DISK ?

I read that error 53 (0x35) is often used as a grab bag since in NT 3x, it would force an immediate halt to some time-consuming network operations.  If that's what's happening, there might be a security issue involved.  If the server thinks that you have no right poking your nose around, it might be using this error to preempt you out of the system.

Do you have any trouble if you use Dialup Networking to logon to that server manually?  If you have not tried it, do so -- the popup error messages could be enlightening.  During the login, you may need to specify a Domain name and/or a valid username/password (recognized by the server)  

And to connect to a drive share, that user name might need to have specific privileges on the specified sharename.

See what happens with the above suggestions.  If you're still having problems, I have some ways to test this out tomorrow.

BTW -- what OS is the host and what OS is the client?

-- Dan
0
 
LVL 1

Author Comment

by:Grailman
ID: 6420074
Actually the remote name was \\\\MyServer\\MyPath

MyBad ;-o
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:Grailman
ID: 6420255
I can connect w/ Dial-up Networking and I get a message that:

"You have successfully connected to the remote server. You may now use the usual Windows NT programs and utilities as if you were directly connected to the network"

When I go to Windows Explorer I see a couple (out of say 2 dozen) of machines on the network but when I click them, I get an error "The network path was not found"

The host is either NT4 or W2K and the client is NT4 with SP5.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6420328
I think that narrows it down to a security issue.  In the Dialup networking, what protocols are in effect?  You could try eliminating all except for NetBeui to try to force a fallback the good old days of Workgroup style security.

Also, the login username and password (and Domain) from the username password prompt must match what is expected by the host.  For testing, add this user to the host and give him administrator priveledges.  Also verify that the shared directory on the host provides full access to everybody on earth.

Check your RAS settings as to what permisssions the dialup connections will receive.

-- Dan
0
 
LVL 1

Author Comment

by:Grailman
ID: 6420639
I can connect w/ Dial-up Networking and I get a message that:

"You have successfully connected to the remote server. You may now use the usual Windows NT programs and utilities as if you were directly connected to the network"

When I go to Windows Explorer I see a couple (out of say 2 dozen) of machines on the network but when I click them, I get an error "The network path was not found"

The host is either NT4 or W2K and the client is NT4 with SP5.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6420722
do i hear an echo?

-- Dan
0
 
LVL 9

Expert Comment

by:BeyondWu
ID: 6420874
Listening...
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 0 total points
ID: 6420887
0
 
LVL 1

Author Comment

by:Grailman
ID: 6432173
Found it!

It turned out that the NIC I had in my machine was bound to the same network as the machine I wanted to map to. Remember I said I could map using the NIC? Well when I unplugged the cable and tried to map after I had made a modem connection, my machine still tried to use the NIC since the networks were the same. Once I released the NIC adapter I was able to map just fine using the modem connection.

Note: I would not have seen this situation if I had tried it on one of our machines in the field since their NIC adapters are bound to another network... DOOH!
0
 
LVL 1

Author Comment

by:Grailman
ID: 6432196
Found it!

It turned out that the NIC I had in my machine was bound to the same network as the machine I wanted to map to. Remember I said I could map using the NIC? Well when I unplugged the cable and tried to map after I had made a modem connection, my machine still tried to use the NIC since the networks were the same. Once I released the NIC adapter I was able to map just fine using the modem connection.

Note: I would not have seen this situation if I had tried it on one of our machines in the field since their NIC adapters are bound to another network... DOOH!
0
 
LVL 3

Expert Comment

by:modder
ID: 6432467
Grailman, as requested I have refunded your points. I've accepted AlexVirochovsky's comment to make it a PAQ. Sorry, Alex, no points, but at least a nice "A" to show in your profile ;-)

modder
Community Support
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question