Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking a file's date 3

Status
Not open for further replies.

nickperez22

Technical User
Jun 13, 2001
62
US
I have a backup routine that compacts and zips the backend before opening an application. This process can take anywhere from 2-5 minutes. I would like to be able to check the zip drive file to see if a backup was already done today and if so skip the compact and backup routine, however I do not know the code to check a file's date.
 
Check the helpfiles on the DateCreated property (filesystemobject) or the FileDateTime function.

Roy-Vidar
 
Take a look at the FileDateTime function:
theTimeStamp = FileDateTime(thePathName)
or:
If CLng(FileDateTime(thePathName)) = CLng(Date()) Then
MsgBox "Already backuped today"
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks so much to both of you. I never knew there was a FileDateTime function in Access.
 
You could also set a flag in your backup procedure, and set it to true when the backup is done successfully (Maybe store the results in a table with the date/time). And then display a message when the app opens as to the success or failure of the backup. If the backup fails, notify the user that a backup needs to be performed. This might be a bit faster than openning the zip drive and doing a search for the backup file. What happens if someone removes the disk from the zip driveprior to openning the app?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top