AlanAnderson
Registered User.
- Local time
- Today, 07:59
- Joined
- Nov 27, 2012
- Messages
- 31
Hi All,
I've just spent a few frustrating weeks trying to resolve an error that occurred when I tried to build a "Restore" programme in VBA.
I want to add that if one googles the web for Error 70 Permission Denied one finds thousands of cases and none are ever fully resolved so I think that it is worthwhile if some of the gurus out there could examine my conclusions and perhaps post something to save others from this frustration.
In my case the user (me) definitely had the correct permissions to save/delete/edit the back end database which was properly closed.
Essentially, IMHO, the problem relates to tables that are linked. When one tries to restore a file one is essentially deleting the existing file and replacing it with the backed up one. If one does this in DOS there's absolutely no problem with permissions but if one does it with VBA from within Access then Access seems to be "smart" enough to see the linking and decide that to delete a linked table is not a good idea so it stops you if you do FileCopy etc. This is even the case when it is 100% guaranteed that all files, tables, forms, queries etc are closed
The only way I've found to get around this is to run the restore programme as a separate stand alone programme and to first do the "Kill" command to entirely remove the back end. Once done then the filecopy and relinking works ok.
I suspect a better way to handle this might be to write a VBA routine that first removes all the links (and possibly the relationships) and then filecopy would probably work.
I hope this thread stimulates someone brighter than me to delve into this issue and finally resolve this issue for all time.
Regards,
Alan
I've just spent a few frustrating weeks trying to resolve an error that occurred when I tried to build a "Restore" programme in VBA.
I want to add that if one googles the web for Error 70 Permission Denied one finds thousands of cases and none are ever fully resolved so I think that it is worthwhile if some of the gurus out there could examine my conclusions and perhaps post something to save others from this frustration.
In my case the user (me) definitely had the correct permissions to save/delete/edit the back end database which was properly closed.
Essentially, IMHO, the problem relates to tables that are linked. When one tries to restore a file one is essentially deleting the existing file and replacing it with the backed up one. If one does this in DOS there's absolutely no problem with permissions but if one does it with VBA from within Access then Access seems to be "smart" enough to see the linking and decide that to delete a linked table is not a good idea so it stops you if you do FileCopy etc. This is even the case when it is 100% guaranteed that all files, tables, forms, queries etc are closed
The only way I've found to get around this is to run the restore programme as a separate stand alone programme and to first do the "Kill" command to entirely remove the back end. Once done then the filecopy and relinking works ok.
I suspect a better way to handle this might be to write a VBA routine that first removes all the links (and possibly the relationships) and then filecopy would probably work.
I hope this thread stimulates someone brighter than me to delve into this issue and finally resolve this issue for all time.
Regards,
Alan