|
-
Oct 4th, 2000, 03:20 PM
#1
Errors from using WNetAddConnection2
Does anybody have a list of errors from using WNetAddConnection2? Specifically I am looking for what error 1326 means. I thought I read that it meant that the user is already logged in, but I can't remember where I read it.
Thanks
-
Oct 4th, 2000, 06:03 PM
#2
Hyperactive Member
Sorry, can't tell you what 1326 is. Found all the error codes by tracking down the .h files from C relating to the WNet commands and then listing them out.
I did however discover that I HATE the WNetAddConnection2 command, mainly because trying to use it without a user name and password defaults it to using the currently logged on user but unless his credentials are floating around the system it will report an access denied error.
So I went to Windows Explorer and connected a drive manually then disconnected it. That placed credentials in the system and the API suddenly worked... Grrrr.
So the next step was to use the "NET USE" DOS command, which created the mapping... but when I used the API after it I got a 1219 error stating that there was a conflict in credentials. Obviously the NET USE command has some priviledged access and generates system credentials and then trying to use the current user conflicts causing the problem.
All of it is listed in MSDN as a problem and I didn't want to pester the user into giving me their password.
Have a look for useage of this command on this fantastic site (http://www.mvps.org/vb/) as it has a good example of using it properly in VB.
-
Oct 5th, 2000, 08:35 AM
#3
Thanks for the reply. I did find a solution, but still
didn't find any info on that error.
I found out that the user name I was using to connect to
the share was specified as being from a different server.
For example, say the user name was "bubba" and I was trying
to map my f: drive to \\server1\share. \\server1\share was
only granting permission to user "bubba" logged in to
"\\server2". So I just changed the username I was passing to WNetAddConnection2 to "\\server2\bubba" and it worked
brilliantly.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|