Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the path of a shared drive

Status
Not open for further replies.

tbiceps

IS-IT--Management
Nov 23, 2005
106
US
Will the GetAbsolutePathName method return directory of a shared folder. Different users in different regions access a database with different directory letter drives. I'm looking for a way to map a user's drive in an automated manner without concern of the drive letter.
 
Code:
Sub MapDrives()
Dim WshNetwork As WshNetwork
Dim CheckDrive As WshCollection
Dim i As Long

Set WshNetwork = CreateObject("WScript.Network")
Set CheckDrive = WshNetwork.EnumNetworkDrives()
For i = 0 To CheckDrive.Count - 1 Step 2
   Debug.Print CheckDrive.Item(i)
   Debug.Print UCase(CheckDrive.Item(i + 1))
Next i
Set CheckDrive = Nothing
Set WshNetwork = Nothing
End Sub

But I don't trust mapped drive letter even if I create the mapping myshelf.

Use \\ServerName\Path

If you already created linked tables, there are many posts on how to relink them using VBA to change the mapped drive to \\ServerName\Path
 
How would you use \\ServerName\Path?
 
Thanks JerryKlmns,

Using \\ServerName\Path is much simpler than what I had anticipated. Great help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top