Anyone understand this problem? Trying to map a network drive
Module
Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszstrPassword As String, ByVal lpszLocalName As String) As Long
Load form
Dim strLocalDriveLetter As String
Dim strPassword As String
Dim strNetworkPathName As String
strLocalDriveLetter = "T:" 'Local drive letter to be mapped
strPassword = "god" 'specify network password if required
strNetworkPathName = "\\lab_techs\c" 'path to network drive
If WNetAddConnection(strNetworkPathName, strPassword, strLocalDriveLetter) > 0 Then
MsgBox ("An Error occurred mapping the drive")
Else
MsgBox ("Drive successfully mapped!")
End If




Reply With Quote