Solved

WNetAddConnection2 - "The network path was not found"

Posted on 2001-08-23
12
3,264 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
How to convert MFC APP to Win32 APP. 19 94
computer science syllabus 3 89
How to print into std::string like sprintf using C++11? 12 81
What is sub-make ? 2 71
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

856 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