I have an application for a customer that has 3 computers in their setup. They use computer A (the boss' computer) to double as a "server" for all their storage. Computers B and C are mapped to computer A for all documents.
In my application, they need to store links to certain files. When Computer B & C save the links and open them, no problem, as the link for everyone is exactly the same, and contains the computer name (by means of the code below).
The problem comes in when computer A saves a link. They, of course, will end up saving it as c:\, and the other computers can't open it up.
Can anyone tell me how I should be saving the links (and how to accomplish this in code), so that they all have the same thing?
I have a small routine that I am using to replace computer B & C mapping information with the computer name. What I don't know is how to get person A to use the name instead of C:!
Thanks to anyone that can help me out!
In my application, they need to store links to certain files. When Computer B & C save the links and open them, no problem, as the link for everyone is exactly the same, and contains the computer name (by means of the code below).
The problem comes in when computer A saves a link. They, of course, will end up saving it as c:\, and the other computers can't open it up.
Can anyone tell me how I should be saving the links (and how to accomplish this in code), so that they all have the same thing?
I have a small routine that I am using to replace computer B & C mapping information with the computer name. What I don't know is how to get person A to use the name instead of C:!
Code:
Function MapDrivePath(sMapString As String)
Dim wshNetwork
Dim oDrives
Dim oPrinters
Dim ii As Integer
Dim strTEMP As String
Set wshNetwork = CreateObject("WScript.Network")
Set oDrives = wshNetwork.EnumNetworkDrives()
MapDrivePath = sMapString
For ii = 0 To oDrives.Count - 1 Step 2
strTEMP = oDrives.Item(ii)
If strTEMP = Left(sMapString, 2) And sMapString <> "" Then
MapDrivePath = oDrives.Item(ii + 1) & Mid(sMapString, 3, Len(sMapString) - 2)
Debug.Print "Drive " & oDrives.Item(ii) & " = " & oDrives.Item(ii + 1)
End If
Next
End Function
Thanks to anyone that can help me out!