基数规则#1:备份数据库! [英] Cardinal Rule # 1: Back up your database!

查看:70
本文介绍了基数规则#1:备份数据库!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的生活,我从来没有理解为什么Access没有自动备份功能,特别是考虑到它变得腐败的恶习!但是,由于它没有,严肃的用户应该制定他/她自己的策略,因为迟早你需要备份!您的数据库将变得腐败,或者您将进行错误的代码修改!最糟糕的情况是您进行了彻底的修改并对其进行了测试,结果发现,几天或几周后修改会影响数据库中您从未梦想过会影响到的部分!备份应该在开发阶段至少每天进行一次,如果你正在为数据库做很多新的或创新的工作,那么更常见。以下是一个很好的方案;我们将调用数据库 Acme.mdb

进入Window Explorer,选择你的数据库然后:


右键单击并单击复制


右键单击并单击粘贴


将进行访问文件列表底部的数据库副本。


它将被称为 Acme.mdb的副本

右键单击和点击重命名


删除?副本?部分,并在最后添加日期,所以

Acme.mdb的副本


变成,例如

Acme02_09_07.mdb


如果你每天制作一份以上的副本,在日期末添加一封信

Acme02_09_07a.mdb Acme02_09_07b.mdb


现在,如果你修改了代码有问题,或者你的数据库损坏了,你可以回到特定的时间点并再次启动,而不是来在这里哭泣?帮助!?

For the life of me I?ve never been able to understand why Access doesn?t have an automatic backup feature, especially given its nasty habit of becoming corrupt! But since it doesn?t, the serious user should develop a strategy of his/her own, because sooner or later you?re going to need that backup! Your db is going to become corrupt or you going to make code modifications that go awry! The worst scenario is that you make modifications and test them out thoroughly, only to find out days or weeks later that the modifications affected a part of your database that you never dreamed it would affect! Backups should be done at least daily during the development stage, and more often if you?re doing a lot of new or innovative work to the database. The following is a scheme that?s served me well; we?ll call the database Acme.mdb

Go into Window Explorer, select your db and then:

Right Click and Click on Copy

Right Click and Click on Paste

Access will place a copy of your db at the bottom of your file listing.

It?ll be called Copy of Acme.mdb

Right Click and Click on Rename

Remove the ?Copy of? part, and at the end add the date, so

Copy of Acme.mdb

becomes, for example

Acme02_09_07.mdb

If you make more than one copy a day, add a letter to the end of the date

Acme02_09_07a.mdb, Acme02_09_07b.mdb etc

Now, if you have a problem with a code modification or your db becomes corrupt, you can go back to a specific point in time and pickup again, instead of coming here and crying ?Help!?

推荐答案


对于我的生活,我从来没有理解为什么Access没有自动备份功能,特别是考虑到它变得腐败的恶习!但是,由于它没有,严肃的用户应该制定他/她自己的策略,因为迟早你需要备份!您的数据库将变得腐败,或者您将进行错误的代码修改!最糟糕的情况是您进行了彻底的修改并对其进行了测试,结果发现,几天或几周后修改会影响数据库中您从未梦想过会影响到的部分!备份应该在开发阶段至少每天进行一次,如果你正在为数据库做很多新的或创新的工作,那么更常见。以下是一个很好的方案;我们将调用数据库 Acme.mdb

进入Window Explorer,选择你的数据库然后:


右键单击并单击复制


右键单击并单击粘贴


将进行访问文件列表底部的数据库副本。


它将被称为 Acme.mdb的副本

右键单击和点击重命名


删除?副本?部分,并在最后添加日期,所以

Acme.mdb的副本


变成,例如

Acme02_09_07.mdb


如果你每天制作一份以上的副本,在日期末添加一封信

Acme02_09_07a.mdb Acme02_09_07b.mdb


现在,如果你修改了代码有问题,或者你的数据库损坏了,你可以回到特定的时间点并再次启动,而不是来在这里哭泣?帮助!?
For the life of me I?ve never been able to understand why Access doesn?t have an automatic backup feature, especially given its nasty habit of becoming corrupt! But since it doesn?t, the serious user should develop a strategy of his/her own, because sooner or later you?re going to need that backup! Your db is going to become corrupt or you going to make code modifications that go awry! The worst scenario is that you make modifications and test them out thoroughly, only to find out days or weeks later that the modifications affected a part of your database that you never dreamed it would affect! Backups should be done at least daily during the development stage, and more often if you?re doing a lot of new or innovative work to the database. The following is a scheme that?s served me well; we?ll call the database Acme.mdb

Go into Window Explorer, select your db and then:

Right Click and Click on Copy

Right Click and Click on Paste

Access will place a copy of your db at the bottom of your file listing.

It?ll be called Copy of Acme.mdb

Right Click and Click on Rename

Remove the ?Copy of? part, and at the end add the date, so

Copy of Acme.mdb

becomes, for example

Acme02_09_07.mdb

If you make more than one copy a day, add a letter to the end of the date

Acme02_09_07a.mdb, Acme02_09_07b.mdb etc

Now, if you have a problem with a code modification or your db becomes corrupt, you can go back to a specific point in time and pickup again, instead of coming here and crying ?Help!?



在主窗体的Close()事件中,试试这个:

On the Close() Event of your Main Form, try this:

展开 | 选择 | 换行 | 行号


ADezii,

您的代码很重要,但我不认为On Close事件适合在项目的开发阶段创建备份。

Linq,

我喜欢你的想法,并将它添加到教程部分,但我建议文件名中的日期总是是显示为 YYYYMMDD 格式。否则,在按顺序排序的文件列表中,将以无助的顺序找到备份。此外,如果一天可以使用多个版本,请考虑使用日期格式 YYYYMMDDHHNN
ADezii,
Your code is important to know about, but I don''t think the On Close event would be appropriate for creating the backup in the development stage of a project.
Linq,
I like your idea, and will add it to the tutorials section but I would recommend that dates in filenames should always be shown as YYYYMMDD format. Otherwise, in a sequentially ordered file list, the backups will be found in an unhelpful order. Also, if multiple versions are possible in a day, consider using the date format YYYYMMDDHHNN.



ADezii,

您的代码很重要,但我不认为On Close事件适合在项目的开发阶段创建备份。

Linq,

我喜欢你的想法,并将它添加到教程部分,但我建议文件名中的日期始终显示为 YYYYMMDD 格式。否则,在按顺序排序的文件列表中,将以无助的顺序找到备份。此外,如果一天内可以使用多个版本,请考虑使用日期格式 YYYYMMDDHHNN
ADezii,
Your code is important to know about, but I don''t think the On Close event would be appropriate for creating the backup in the development stage of a project.
Linq,
I like your idea, and will add it to the tutorials section but I would recommend that dates in filenames should always be shown as YYYYMMDD format. Otherwise, in a sequentially ordered file list, the backups will be found in an unhelpful order. Also, if multiple versions are possible in a day, consider using the date format YYYYMMDDHHNN.



NeoPa:

我想要保证唯一性的原因是:

NeoPa:
What I had in mind to guarantee uniqueness was something in the order of:

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


这篇关于基数规则#1:备份数据库!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆