Red X on Mapped Network Drive

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Hello:

I have queries appending data to another computer's
harddrive for backup. I use a mapped network drive
(Drive J).

Sometimes when the computers are rebooted the computer
has a red "X" on the Drive J and you must physically
click on that icon in my computer to be able to access
this mapped network drive.

How do I, using VBA, do an "If then" to check and see
if "J" is connected. If not executed a command to
connect. If it is connected I know what to do (that is
run my regular query or copy function).

Thanks for your help.
 
Gary,

Have you considered using the full UNC ( for example,
\\OtherComputer\Backups\Databases )of the other computer rather than a drive
mapping? As long as the permissions to that computer are set up properly,
you can do your backups without worrying about letter mappings.

Let us know.
 
-----Original Message-----
Gary,

Have you considered using the full UNC ( for example,
\\OtherComputer\Backups\Databases )of the other computer rather than a drive
mapping? As long as the permissions to that computer are set up properly,
you can do your backups without worrying about letter mappings.

Let us know.

--
Cheryl Fischer
Law/Sys Associates
Houston, TX




.
Hello Cheryl:

I use the same program on seven different networks.
Because the computers have different names, it is
necessary to map the drive.

Gary.
 
-----Original Message-----
Hi,
Are you saying that your code can't access the share
until it's actually clicked on?
How are you trying to access it? Post the relevant code.

Or, you can get the UNC path from the drive letter:
http://www.mvps.org/vbnet/code/network/uncfrommappeddrive ..htm

--
HTH
Dan Artuso, Access MVP


"Gary" <[email protected]> wrote in
message news:[email protected]...
.
Hello Dan:

Thanks for the help.

Here is the code.

Set fsn = CreateObject("Scripting.FileSystemObject")
fsn.copyfile "c:\gil\gil_be.mdb", "j:\backup\"


Sometimes, however, J is not connected and will return an
error. The way to remedy is to double click on the My
computer icon and double click on the J Drive. This
removes the "Red X" and allows you to connect to the
network drive. You can then reexecute the command and it
will work.

Gary.
 
Hi,
Use the code in the link I provided to get the UNC path. Then you'll never have to worry
about J. Unless of course that fails as well because it thinks J is not connected.
Give it a try, it's the only thing I can think of.
 
Back
Top