Access 2000可视基本代码运行速度太快,无法完成备份 [英] Access 2000 visual basic code runs too fast for backup to complete

查看:96
本文介绍了Access 2000可视基本代码运行速度太快,无法完成备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

怎么做,

为了备份我的数据库(Access 2000),我试图只备份表和它们的数据,因为这样可以节省空间并允许导回到实际数据库。我希望将数据复制到一个过时的备份数据库中,这样就可以执行特定的恢复,旧的备份也不会丢失。


我的vb代码创建了一个新的空白数据库并将数据复制到表通过docmd.runSQL。代码的两个方面都很好;当我想一气呵成时,问题就出现了。创建空白数据库所花费的时间远远大于vb代码执行所需的时间,导致

How do,
For backing up my database(Access 2000), i am trying to just back up the tables and their data, as this will save on space and allow for importing back into the actual database. I want the data copied into a dated backup database so a specific restore can be performed and old backups arent lost.

The vb code i have makes a new blank database and copies the data into tables through docmd.runSQL. Both aspects of the code work fine; the problem arises when i want to do both in one go. The time it takes to create the blank database is far greater than the time the vb code takes to execute, resulting in

运行时错误'3045'' :

无法使用''C:\Docu .....备份2007-02-15 22.16.55.mdb'';文件已被使用。

推荐答案


怎么做,

为了备份我的数据库(Access 2000),我试图只备份表及其数据,因为这将节省空间并允许导回到实际的数据库中。我希望将数据复制到一个过时的备份数据库中,这样就可以执行特定的恢复,旧的备份也不会丢失。


我的vb代码创建了一个新的空白数据库并将数据复制到表通过docmd.runSQL。代码的两个方面都很好;当我想一气呵成时,问题就出现了。创建空白数据库所花费的时间远远大于vb代码执行所需的时间,导致
How do,
For backing up my database(Access 2000), i am trying to just back up the tables and their data, as this will save on space and allow for importing back into the actual database. I want the data copied into a dated backup database so a specific restore can be performed and old backups arent lost.

The vb code i have makes a new blank database and copies the data into tables through docmd.runSQL. Both aspects of the code work fine; the problem arises when i want to do both in one go. The time it takes to create the blank database is far greater than the time the vb code takes to execute, resulting in
运行时错误'3045'' :

无法使用''C:\Docu .....备份2007-02-15 22.16.55.mdb'';文件已被使用。


  1. 将空(模板)数据库存储在目标文件夹中。
  2. 使用 FileSystemObject.CopyFile()将模板数据库复制到新的(正确命名的)文件。
  1. Store an empty (template) database in the destination folder.
  2. Using FileSystemObject.CopyFile() copy your template database to a new (correctly named) file.

现在应该可以处理您的SQL命令。它还应该允许您在模板文件中保存各种设置,否则设置可能会更复杂。

This should now be in a position to handle your SQL commands. It should also enable you to save various settings in the template file that might otherwise be more complicated to set up.


您可能还想检入应用程序自动化,帮助您整理自动化代码。
You may also want to check in Application Automation to help you tidy up your automation code.


这篇关于Access 2000可视基本代码运行速度太快,无法完成备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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