Copying a file

I need subroutines to do the following:

1.  A subroutine called "Backup" which will copy the file "hockey.mdb" to "hockey.bak" (replacing it)

2.  A subroutine called "Revert" that will copy the file "hockey.bak" to "hockey.mdb" (replacing it)

3.  A function called TestBackup that will read the time and date stamp on "hockey.bak" and return it (as a string);  if the file "hockey.bak" doesn't exist, it will return "never"

I am not asking for a fully coded version of all of them...just the parts where I have to manipulate the shell (copy files, check timestamp).

I am without documentation, so I am hoping this is fairly trivial.
LVL 5
scrapdogAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SLECommented:
Private Sub DoCopy(sSource, sDest)
    FileCopy sSource, sDest
End Sub

Private Function TestBackup(sBackup As String) As String
    TestBackup = "NEVER"
   
    If Dir(sBackup) <> "" Then
        TestBackup = FileDateTime(sBackup)
    End If
End Function

Put the following in your code:

i) DoCopy App.Path & "\hockey.mdb", App.Path & "\hockey.bak"
ii) DoCopy App.Path & "\hockey.bak", App.Path & "\hockey.mdb"
iii) TestBackup(App.Path & "\hockey.bak") will return date & time or NEVER if it does not exist


SLE
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
scrapdogAuthor Commented:
Excellent...very simple.  Thanks.
0
jgoodierCommented:
thanks guys, works great.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.