views:

32

answers:

2

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?

+2  A: 

Any 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!

Larry Wang
+1 for *consistent and everyone knows*. Consider storing your backup copies in a separate folder to lessen the risk they are used accidentally ... without changing the file name extension.
HansUp
@HansUp: Good suggestion. I took it for granted that backups would not be stored in the same place, but it's worth a mention. I've added it to the answer.
Larry Wang
+1  A: 

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

HansUp