i am constantly making changes to access and excel file macros and databases. what i usually do before i modify the file is i make a copy of the file and rename it to the filename_todaysdate.ext
. is this the proper/safest way of doing things?
views:
32answers:
2Any way can be the 'right' way as long as you are consistent and everyone knows the system.
That said, I would change the extension: filename_date_ext.old
and moving the backup files to a folder clearly marked 'backup' in order to easily sort out the backups and prevent accidental use of old data. After all, some original filenames may contain the date too!
Your backup strategy is based on copying the entire Excel or Access file ... which may be just fine for your requirements. I don't do much Excel, but with Access there are many times I prefer saving just selected pieces rather than a complete copy of the entire MDB. You can imagine how much disk space would be consumed by multiple copies of a large MDB ... say hundreds of megabytes, for example.
You can use the undocumented SaveAsText method to save individual database objects to text files:
Application.SaveAsText acForm, "frmFoo", "C:\Backup\frmFoo.txt"
O'Reilly's Access Cookbook offers another granular approach to backing up database objects. See Recipe 6.8 Back Up Selected Objects to Another Database