FileCopy Fails, but Inconsistently

L

LarryP

I have two different databases where I want to simply copy a number of
network files to a folder on my c:\ drive. In one case it works fine; in the
other I get a Runtime Error 70, Permission Denied. I've closely examined the
properties of the two destination folders and can see no difference. The
code for the two procedures, first the one that works and then the one that
doesn't, are shown below. Any and all ideas welcome.

By the way, in trying to find a fix I have modified the code in the first
procedure so that it more closely parallels the second, in that it uses a
variable for part of the destination string, and it still worked fine. It
appears to be only in the second database that this problem is dogging me.


*********This one works just fine**********

Public Function LoadTheFiles()
Dim strPath As String
strPath = "c:\Toolsmaster\"
FileCopy "\\apfs\projs\prodcntl_ops\Entrpris\Data\PRISM\MSAccess
Tools\PCMetrics Tool.mdb", strPath & "PCMetrics Tool.mdb"
FileCopy "\\apfs\projs\prodcntl_ops\Entrpris\Data\PRISM\MSAccess
Tools\VSMetrics Tool.mdb", strPath & "VSMetrics Tool.mdb"

…additional lines to copy more files

End Function

*****Extract of second procedure -- this one throws the error:

…

Path1 = "\\apfs\projs\prodcntl_ops\Entrpris\Data\PRISM\"
Path2 = "c:\NAPI Tool Files\"

…

CopyIfNewer Path1 & "PTS Tool\PTS BE.mdb", Path2 & "PTS BE.mdb"
CopyIfNewer Path1 & "Shared Access Databases\Tools Update Status.mdb",
Path2 & "Tools Update Status.mdb"
CopyIfNewer Path1 & "Shared Access Databases\MasterCal.mdb", Path2 &
"MasterCal.mdb"
 
L

LarryP

Sorry, Alex, I don't quite follow that one. The database where my FileCopy
procedure is running obviously is open; as to the files I'm trying to copy,
some are .mdb and some are other things -- .txt, .xls, etc. I'll do some
further experimenting with this and see if I can get it to work when I know
for certain that nothing I'm trying to copy is in use by anyone else. If
that's not the advice you were trying to give me, please clarify.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top