Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question on WNetAddConnection
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00205741
Message ID:
00205752
Views:
17
>All I am trying to map a network drive from WIN NT workstation with
>WNetAddConnection:
>
>DECLARE Integer WNetAddConnection IN WIN32API STRING @, STRING @, STRING @
>lcRemoteName = "\\Computer\Resource"
>lcPassword = "" && Connect using no password
>lcLocalName = "E:"
>
>? WNetAddConnection( @lcRemoteName, @lcPassword, @lcLocalName)
>
>
>Returns error 1326 (invalid User I think). Can I pass a User-ID to this function?? if so where does it go in the declare and call?
>
>Thanks

Paul,

In order for Windows to use the password from its list, you must pass a null pointer. So
? WNetAddConnection(@lcRemoteName, 0, @lcLocalName)
is what you need.

1326 is logon failed and could be caused by passing an empty string rather than null pointer. If you have the password, just pass it by reference.

hth,
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform