S
Stapes
Set fileObj = CreateObject("scripting.filesystemobject")
fileObj.CopyFile strBackEndName, strBackupName, True
Stapes
fileObj.CopyFile strBackEndName, strBackupName, True
Stapes
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
That sets a reference to FSO (File System Object), which is part of VB
Scripting. It then uses FSO's CopyFile method to make a copy of the file.
Now, since I was reading another thread you have going, I'm guessing you
want to use this because it doesn't give you the "File In Use" error you're
getting through other methods. Be aware that just because FSO's CopyFile
method will copy a file that's in use, that doesn't mean it's a good idea to
do so. That's especially true with Access databases: it's entirely possible
that the copy will be in an inconsistent state because Access was doing
something to the file when the copy took place. In other words, your backup
copy may be incomplete, so that relying on it would be a bad idea.
--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)
- Show quoted text -
Stapes said:So is this routine any safer:

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.