使用代码制作当前数据库的副本 [英] Making a copy of the current database using code

查看:81
本文介绍了使用代码制作当前数据库的副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我创建的数据库中,我需要能够使用用户在另存为对话框窗口中指定的名称重命名文件

(I

已经有了启动这个窗口的代码)。换句话说,我需要编写代码来制作当前数据库的副本,然后使用新名称保存

。我已经读过复制一个当前正在使用的文件

是个坏主意,所以我不知道该怎么办。任何

建议?

In the database that I am creating I need to be able to rename the file
with a name that the user specifies using the Save As Dialog window (I
already have the code that brings up this window). In other words, I
need to write code that makes a copy of the current database and saves
it with a new name. I''ve read that it is a bad idea to copy a file
that is currently in use so I am at a loss of what I should do. Any
suggestions?

推荐答案

我们无法判断你告诉我们什么,但是,


这是一个拆分应用程序(即BE和FE)


您是否正在尝试备份数据或表单?


如果它是FE和BE,重命名BE会破坏链接,你会想要b / b
必须复制它并重命名副本。此外,它可能不允许你重命名你所在的mdb

。通常它会允许副本

而不是重命名。因此,SaveAs可能不是那种去b
的方式,因为它说你必须打开mdb,如果它是你需要保存的美元,因为它没有任何关系数据。


BE的副本存在在

更新中间复制的风险,因此至少可以对副本进行修改。

forstall的唯一方法是,当它完成时,每个人都必须离开BE。

We cannot tell from what you have told us, However,

Is this a split application (ie. BE and FE)

Are you trying to backup the data or the forms?

If it is a FE and BE, renaming the BE will destroy the links, You would
have to copy it and rename the copy. Also it will probably NOT allow
you to rename the mdb you are in anyway. Usually it will allow a copy
but not a rename. Consequently SaveAs is probably not the way to go
since it says you have to have the mdb open and if it is the FE that
you are saving as it does nothing about the data.

Copy of the BE runs the risk of copying right in the middle of an
update so that at least the copy may be corruped. The only way to
forstall that is that everyone would have to be out of the BE when it
was done.


感谢您的回复。它不是我想要创建的备份,

它最终将成为一个单独的数据库,用户将获得
访问权限。我的数据库的目的有点复杂......我正在创建

a数据库,它为人们提供了一种简单方便的方法来将

数据加载到其中并实际创建一个他们的新数据库(全部用于

同样的目的提醒你,但不同的数据)。我认为最好的方法是让他们将所需数据加载到这个主要的
数据库中,然后用新名称复制数据库。我原本打算把b
计划打开一个空白数据库,然后将数据导入其中

但我认为这将是一个更简单的解决方案。可能不是。

Thanks for the reply. It is not a backup that I am trying to create,
it will will eventually become a seperate database that users will
access. The purpose of my database is somewhat complex...I am creating
a database that provides a simple and easy way for people to load their
data into it and actually create a new database for them (all for the
same purpose mind you, but different data). I thought the best way to
go about this was to have them load the data required into this main
database and then copy the database with a new name. I originally
planned to have a blank database open and just export the data into it
but I thought this would be an easier solution. Probably not though.



Ja ************ @ ge.com 写道:
感谢您的回复。它不是我试图创建的备份,它最终将成为用户将访问的单独数据库。我的数据库的目的有点复杂......我正在创建一个数据库,它为人们提供了一种简单方便的方法,可以将人们的数据加载到数据库中,并为他们创建一个新的数据库(全部用于
同样的目的会介意你,但不同的数据)。我认为解决这个问题的最好方法是让他们将所需数据加载到这个主数据库中,然后用新名称复制数据库。我原本打算打开一个空白数据库并将数据导入其中
但我认为这将是一个更简单的解决方案。可能不是。
Thanks for the reply. It is not a backup that I am trying to create,
it will will eventually become a seperate database that users will
access. The purpose of my database is somewhat complex...I am creating
a database that provides a simple and easy way for people to load their
data into it and actually create a new database for them (all for the
same purpose mind you, but different data). I thought the best way to
go about this was to have them load the data required into this main
database and then copy the database with a new name. I originally
planned to have a blank database open and just export the data into it
but I thought this would be an easier solution. Probably not though.




对新主题行感到抱歉。它不会让我正常回应。


你仍然没有告诉我们这是否是BE / FE情况,因为

将确定我们可以提供的响应类型,并允许我们

表示需要注意的陷阱。



Sorry for the new topic line. It won''t let me respond normally.

You still haven''t told us if this is a BE/FE situation, because that
will determine the type of response we can offer, and allow us to
indicate pitfalls to watch for.


这篇关于使用代码制作当前数据库的副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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