Code to copy across network to ext drive on computer on network

Mike375

Registered User.
Local time
Tomorrow, 00:11
Joined
Aug 28, 2008
Messages
2,548
The last line in red is the problem area. I have tried both e and e: The Debug is always (when I cut out error resume) can't find path. Access 2016 and Windows 10 and .mdb file

Edit: Ext E is shared. Have also tried \\Mike\ before e

Private Sub Label33_Click()

FileCopy "c:\ViperResides\Viper.mdb", ("c:\ViperBackUp\Viper " & Format(Now, "YYYY-MM-DD") + " " & Format(Now, "hh-mm-ss") + ".mdb")

On Error Resume Next

FileCopy "C:\ViperResides\Viper.mdb", "\\MikeM\ViperBackUp\Viper " + Format(Now, "YYYY-MM-DD") + " " & Format(Now, "hh-mm-ss") + ".mdb"

On Error Resume Next

FileCopy "C:\ViperResides\Viper.mdb", "\\MikeMCG\ViperBackUp\Viper " + Format(Now, "YYYY-MM-DD") + " " & Format(Now, "hh-mm-ss") + ".mdb"

On Error Resume Next

FileCopy "C:\ViperResides\Viper.mdb", "\\Mike\ViperBackUp\Viper " + Format(Now, "YYYY-MM-DD") + " " & Format(Now, "hh-mm-ss") + ".mdb"

On Error Resume Next

FileCopy "C:\ViperResides\Viper.mdb", "\\MMcG\ViperBackUp\Viper " + Format(Now, "YYYY-MM-DD") + " " & Format(Now, "hh-mm-ss") + ".mdb"

On Error Resume Next

FileCopy "c:\ViperResides\Viper.mdb", ("e\Viper " & Format(Now, "YYYY-MM-DD") + " " & Format(Now, "hh-mm-ss") + ".mdb")

DoCmd.RunMacro "MBoxCopying", , ""

End Sub
 
Last edited:
If "e" is a drive why doesn't it have a colon after it like:

FileCopy "c:\ViperResides\Viper.mdb", ("e:\Viper " & Format(Now, "YYYY-MM-DD") + " " & Format(Now, "hh-mm-ss") + ".mdb")
 
If "e" is a drive why doesn't it have a colon after it like:

FileCopy "c:\ViperResides\Viper.mdb", ("e:\Viper " & Format(Now, "YYYY-MM-DD") + " " & Format(Now, "hh-mm-ss") + ".mdb")

Have tried both e and e: In fact just in case I had a typo I copied and pasted you line but did not work.

Hopefully in a couple of days time I will have an older laptop here that is W7 and Access 2003 and see how that goes because I have the same sort of code that used to work.

Also tried both flash drive and standard ext hard disk.
 
It is possible to set a Group Policy to disable removable drives. Could that be the problem?
 
It is possible to set a Group Policy to disable removable drives. Could that be the problem?

Don't know what you mean by that.

However, the drive works fine. If I run the code on computer MkeM, which is the one the flash drive is connected to then it puts the viper/date/time file on the drive. The flash drive is on a USB hub but I also tried it direct on MikeM usb.

I have also tried \\MikeM\ befrore the e: and also tried creating a folder ViperBackUp as in c:\ViperBackUp on the flash drive and copying to that but to no avail.

Have also tried c\e etc.

I got some things to do now so tomorrow I will set up with the flash drive on one of the other Toshibas and play around.

Who needs computer games:D
 
You can't use "e:\" across the network. You should use the sharename of the drive as it is configured in the share properties. Be sure to set the share permissions too.

\\computername\sharename\path\file

If you have admin rights you can use the default sharename.

\\computername\e$\path\file
 
Many thanks. Permissions/Share name did the trick.

FileCopy "c:\ViperResides\Viper.mdb", "\\MikeM\EE\Viper " & Format(Now, "YYYY-MM-DD") + " " & Format(Now, "hh-mm-ss") + ".mdb"
 

Users who are viewing this thread

Back
Top Bottom