When file is created there is a timestamp associated with it, in the files properties, but if you move the file the timestamp is changed to the date and time of the move. Is there any way to recover the original properties of the file, which includes the original date created.
I just happened to be looking at a similar issue myself. In my case I'm using a temp database and trying to delete it after a period of time and create a new one in its place. The odd thing is that after deleting and recreating it, it retains the same creation date.
From what I found it's a little difficult to set the created, modified, and accessed dates but I found some code that will do it.
While it does not recover a changed created date, it will allow you to set it to whatever date you want.
In the VBE, go to the file tab and select import files and import these 3 .bas files. The modTest.bas file is just for testing and the other 2 are required.
I just happened to be looking at a similar issue myself. In my case I'm using a temp database and trying to delete it after a period of time and create a new one in its place. The odd thing is that after deleting and recreating it, it retains the same creation date.
From what I found it's a little difficult to set the created, modified, and accessed dates but I found some code that will do it.
While it does not recover a changed created date, it will allow you to set it to whatever date you want.
In the VBE, go to the file tab and select import files and import these 3 .bas files. The modTest.bas file is just for testing and the other 2 are required.
My problem is based on a lack of knowledge. In my app all data comes from phone calls. I can get the timestamp from the file and automatically enter it into a data entry type form. The problem was, during some development, I relocated the file, and lo all the dates created were changed to the date that I moved the file. I am not talking about an extraordinary amount of data, maybe 40 records or so. But if I can devine a way to conjure up the original dates then your code will be a huge help.
Moke, I just found a way to get the original timestamps. The way my app works is that the date and time are logged when a call comes in. I also save every version of the app that I worked on, every time I made a change, I saved the app with a new version number, etc. In those old apps, in the Master File, are the dates and times that were logged prior to me moving the folder, thus I think I can recover most of the files, with the use of that spiffy bit of code you sent to restore the timestamps.
(The link has a funny name here in the body of my post but when I examine the text of the link, it is pointing to the correct article.)
For better or worse, MS decreed that after a file move, the creation date would change. You have to do a specific type of copy. A backup/restore method should preserve dates, and the ROBOCOPY command appears to also have that ability.
Chip Pearson's site has code that could be used to reset the file's creation date. You can read about it here:
Let's explore how we can use VBS/VBA to update a file's Date Created, Date Modified and Last Accessed property values.
www.devhut.net
Here is a link to Chip's article on this subject. You can read it and perhaps download stuff, but you will not be able to ask him any questions as Chip has passed away.
(The link has a funny name here in the body of my post but when I examine the text of the link, it is pointing to the correct article.)
For better or worse, MS decreed that after a file move, the creation date would change. You have to do a specific type of copy. A backup/restore method should preserve dates, and the ROBOCOPY command appears to also have that ability.
Chip Pearson's site has code that could be used to reset the file's creation date. You can read about it here:
Let's explore how we can use VBS/VBA to update a file's Date Created, Date Modified and Last Accessed property values.
www.devhut.net
Here is a link to Chip's article on this subject. You can read it and perhaps download stuff, but you will not be able to ask him any questions as Chip has passed away.