Here is the function that i have used in C and it should work in VB but I'm not good a translating from C to VB.
The Function is WNetAddConnection2 this allows you to map a drive letter to a shared folder. The definition of this API call is in the Win32 API help file.
Following is the function definition in C for anyone who can translate it:
DWORD WNetAddConnection2(
LPNETRESOURCE lpNetResource, // points to //structure that specifies //connection details
LPCTSTR lpPassword, // points to password string
LPCTSTR lpUsername, // points to user name string
DWORD fdwConnection // set of bit flags that specify // connection options
);
The LPNETRESOURCESTRUCTURE :
typedef struct _NETRESOURCE { // nr
DWORD dwScope;
DWORD dwType;
DWORD dwDisplayType;
DWORD dwUsage;
LPTSTR lpLocalName;
LPTSTR lpRemoteName;
LPTSTR lpComment;
LPTSTR lpProvider;
} NETRESOURCE;
The Function is located in the MPR.LIB Library
Hope This Helps
Jonathan Houston