Solved

WNetAddConnection2 - "The network path was not found"

Posted on 2001-08-23
12
3,295 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
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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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 use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

749 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