Results 1 to 4 of 4

Thread: Drive Map API call

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    Drive Map API call

    Anyone familiar with this API call?

    Declare Function WNetAddConnection2 Lib "mpr.dll" Alias "WNetAddConnection2A" (lpNetResource As NETRESOURCE, ByVal lpPassword As String, ByVal lpUserName As String, ByVal dwFlags As Long) As Long

    Every time I specify username and password, I got an error 1219 - but if dont supply those credentials, it works fine.

    Can someone sets some lights on this question?

    I also ran into another issue that if a drive is already mapped, my vb exe maps another drive. Say I is mapped, so map J. But when I want to disconnect the drive, I didn't want to disconnect I because it wasn't mapped by my exe. How can I achieve that?

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    Re: Drive Map API call

    Error 1326 too.

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Drive Map API call

    I've never used that API before. Here is a VB example on vbnet. The sample doesn't use a password, but does use a username.

    It might be helpful to describe what those errors are. Numbers aren't much help
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: Drive Map API call

    I think the errors speak for themselves:

    ERROR_SESSION_CREDENTIAL_CONFLICT
    1219 (0x4C3) Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again.


    ERROR_LOGON_FAILURE
    1326 (0x52E) Logon failure: unknown user name or bad password.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width