Mapped drive not showing. (1 Viewer)

John Sh

Member
Local time
Today, 13:37
Joined
Feb 8, 2021
Messages
535
This might be more a windows problem than Access but I post it here on the off chance.
While working on my database from home, I log into a remote server via a VPN.
I have two drives mapped to the server and when I connect, neither drive is active until I open them via file explorer.
I use the following code to detect any drives with particular folders to set the paths for the database.
So if either, or both drives are inactive, albeit connected, oFSO fails to detect them and my paths are incorrect.
"oFSO" is a public function in a module.

Code:
Private Sub getDrives()
'   tempvars!drive is any removable drive.
'   tempvars!Patha is the network drive that holds image files and other documents.
'   tempvars!Pathb is the network drive that holds the back-end files and individual front-end files.
    Dim sDrive As Object
    For Each sDrive In oFSO.Drives
        If oFSO.FolderExists(sDrive & "\Images") Then
            If sDrive.DriveType = 2 Then
                TempVars!Drive = sDrive & "\"
            ElseIf sDrive.DriveType = 3 Then
                TempVars!PathA = sDrive & "\"
            End If
        End If
        If sDrive.DriveType = 3 And oFSO.FolderExists(sDrive & "\Split") Then
            TempVars!PathB = sDrive & "\"
        End If
    Next
End Sub
 
I don't necessarily have an answer, but your problem isn't unknown.


This next link doesn't merely report the problem, it also offers some possible suggestions, going as far as a registry edit.


This is a less complex approach.


Here is another relevant article:


Somewhere in this list you might find what you need.
 
I don't necessarily have an answer, but your problem isn't unknown.
Somewhere in this list you might find what you need.
Thanks Docman.
Looks like I've a bit of reading to do.
 

Users who are viewing this thread

Back
Top Bottom