Apply timestamp to BE file

H

Hugh self taught

Hi All,

I use filecopy to make a backup of my backend file with a .bak extention
added to the original filename. However the filecopy created file also has
the same timestamp as the source BE file & I'd like it to reflect the
timestamp when the filecopy was actually done.

Any easy solutions to achieving that?
 
S

Stuart McCall

Hugh self taught said:
Hi All,

I use filecopy to make a backup of my backend file with a .bak extention
added to the original filename. However the filecopy created file also has
the same timestamp as the source BE file & I'd like it to reflect the
timestamp when the filecopy was actually done.

Any easy solutions to achieving that?

http://www.smccall.demon.co.uk/MiscApi.htm#FileDateTime

Using that you can modify any of the three time stamps on a file: Creation
time, Last accessed time and Last modified time.
 
D

Douglas J. Steele

Dim strOrigBE As String
Dim strCopyBE As String

strOrigBE = "E:\Folder\MyBE.MDB"
strCopyBE = "E:\Folder\MyBE_" & _
Format(Now, "yyyy\-mm\-dd hh\:nn\:ss") & .MDB

If Len(Dir("E:\Folder\MyBE.LDB")) > 0 Then
MsgBox "Sorry, the database is in use." & vbCrLf & _
"I can't back it up."
Else
FileCopy strOrigBE, strCopyBE
End If
 
H

Hugh self taught

Hi Douglas,

I was in 2 minds as to which way to go about my backup BE file. ie Make
seperate new ones for each backup as your solution will do or just to correct
the currently copied files' datetime stamp.

Stuart has also pointed me his solution on his web site which gives me both
options to choose from.

Many thanks
 
H

Hugh self taught

Hi Stuart,

I had a look at your link & I will give it a try & keep it stored away for
future use. I have to situations to implement something in this regard &
yours will suit one while Douglas' solution will suit the other so I win all
round on this one.

Many thanks
 
S

Stuart McCall

Hugh self taught said:
Hi Stuart,

I had a look at your link & I will give it a try & keep it stored away for
future use. I have to situations to implement something in this regard &
yours will suit one while Douglas' solution will suit the other so I win
all
round on this one.

Many thanks

You're welcome. If you have any trouble implementing it, shout back.

All the best for Christmas
 

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

Top