重命名/备份文件的正确方法

发布于 2024-09-11 03:47:28 字数 117 浏览 0 评论 0原文

我经常对 access 和 Excel 文件宏和数据库进行更改。在修改文件之前我通常会做的是复制该文件并将其重命名为filename_todaysdate.ext。这是正确/最安全的做事方式吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花开浅夏 2024-09-18 03:47:28

只要你保持一致并且每个人都了解系统,任何方法都可以是“正确”的方法。
也就是说,我会更改扩展名:filename_date_ext.old,并将备份文件移动到明确标记为“备份”的文件夹中,以便轻松整理备份并防止意外使用旧数据。毕竟,某些原始文件名也可能包含日期!

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!

故笙诉离歌 2024-09-18 03:47:28

您的备份策略基于复制整个 Excel 或 Access 文件...这可能正好满足您的要求。我不怎么使用 Excel,但使用 Access 很多时候我更喜欢仅保存选定的部分,而不是整个 MDB 的完整副本。您可以想象大型 MDB 的多个副本会消耗多少磁盘空间……例如数百兆字节。

您可以使用未记录的 SaveAsText 方法将单个数据库对象保存到文本文件:

Application.SaveAsText acForm, "frmFoo", "C:\Backup\frmFoo.txt"

O'Reilly 的 Access Cookbook 提供了另一种备份数据库对象的精细方法。请参阅秘诀 6.8 将选定的对象备份到另一个数据库

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文