自动构建Access 2007数据库 [英] Automate build of Access 2007 database

查看:341
本文介绍了自动构建Access 2007数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为我们构建过程的一部分,我们必须创建一个Access ACCDB(2007)数据库。数据库构成我们应用程序的当前前端,并且必须(在其他原因)在构建过程的初始阶段构建。



目前,这是一个手动过程,我希望自动化。我们的数据库包括多个表,公式,查询等。我相信我们实际上接近了Access实际上能够处理的限制,所以我们尽量不再添加任何东西。



我看了一下这个项目:
http://buildmsaccessdb.codeplex .com /



它似乎工作得很好。然而,在我们的项目中,我们还有一个ACD文件,它是一个二进制文件,其中包含许多系统相关的表。我不是一个向导,当涉及Access开发。我刚刚接管了处理构建过程的任务。



每当我使用上述项目包含ACD文件时,我得到一个COM互操作异常。



我们使用StarTeam作为我们的源代码控制,并且目前遇到的主要问题,当试图从源控制系统创建我们的数据库。我有时花费几个小时只是重试从源控制创建数据库,因为每次Access尝试导入ACD文件时出现未知的故障。



我们已尝试停用Access中的任何宏以及可能在从数据库阶段创建期间自动激活的ACD文件。我们怀疑这可能会中断数据库创建过程,但问题仍然存在:我们只能够在多次尝试和部分纯粹的运气后,从源代码控制创建访问数据库!我想通过自动化整个事情来补救。



有些人可能会指出,最好的开始是找到问题,提取ACD和其他)源文件从Starteam。我的(初始)承担这一点是,如果它归结为绝对好运,无论如何,我宁愿让它自动化,然后让计算机浪费它的时间试图建立Access数据库,然后让我监控的过程。



任何有关如何解决在源代码控制系统构建中自动获取Access数据库问题(如持续集成)的帮助或提示是最受欢迎的。



当然,我也想建议如何解决无法从源代码管理创建数据库的问题,而没有一定量的蠢事。

解决方案

我们最终设法排序:



如果我们使用二进制ACD文件创建数据库的起点,一旦导入数据库,其内容也将可用。以它为起点我的意思是


  1. 将ACD文件复制到相应的目标位置

  2. 将acd文件重命名为MyCompanyName.accdb

  3. 将MyCompanyName.accdb提供为MS Access数据库,以将文件导入MSBuildAccess项目

因此,ACD文件不应与其他文件一起导入,而应将其作为起点。



除了上述步骤之外,我们还在Ms Access中有一个与UIRibbon类相关的构建错误。可以通过创建MSBuildAccess项目文档中提及的参考文件来解决此问题(请参阅 http://buildmsaccessdb.codeplex.com / documentation )。



现在,我们只需要在编译访问数据库时解决内存不足的问题。这将很可能会消失,因为我们减少Access项目的大小。这是我们的经验,我们的Access解决方案是在Access能够处理的模块,报告,表单等的数量的极限。
有关该问题的更多信息,请参阅这些参考: p>


  • http://help.lockergnome.com/office2/Create-accde-file-error--ftopict802934.html

  • http://stackoverflow.com/questions/1300632/compiling-an-access-2007-accdb-into-accde

  • http://bytes.com/topic / access / answers / 518438-cant-create-mde


As part of our build process we have to create an Access ACCDB (2007) database. The database constitutes the current front-end of our application and must be (for other reasons) build during the initial phase of the build process.

Currently, this is a manual process which I'm hoping to automate. Our database consists of MANY tables, formulas, queries, etc. I believe we're actually close to the limit of what Access is actually able to handle so we try not to add anything further to it.

I've had a look at this project: http://buildmsaccessdb.codeplex.com/

and it seems to work pretty well. However, in our project we also have an ACD file, which is a binary file that contains a number of systems related tables. I'm by no means a wizard when it comes to Access development. I've just taken over the task of handling the build process.

Whenever I use the above project to include the ACD file I get a COM interop exception. I don't have the error message in front of me right now, but I could post it if it furthers the cause.

We use StarTeam as our source control and are currently experiencing major issues, when trying to create our database from the source control system. I sometime spend hours just retrying to get the database created from source control because an unknown failure arises every time Access tries to import the ACD file.

We've tried to deactivate any macros in Access and the ACD file which might have been automatically activated during the creation from database phase. We suspected that this might have interrupted the database creation process, however the issue persisted: We're only able to create our access database from source control after numerous attempts and a portion of sheer luck! Something I would like to remedy by automating the whole thing.

Some of you might point out that the best place to start would be to find the issue with extracting the ACD (and other) source file from Starteam. My (initial) take on this is that if it comes down to sheer luck anyway, I would rather have it automated and then let a computer waste it's time trying to build the Access database then having me monitoring the process.

Any help or hints on how to resolve the issue of getting an Access database within a source control system build automatically (i.e. continuous integration) are most welcome.

Of course I would also like suggestions on how to resolve the issue of not being able to create the database from source control without a certain amount of dumb luck.

解决方案

We eventually managed to sort things out:

If we use the binary ACD file as the starting point for creating our database it's content will also be available once the database has been imported. By using it as a starting point I mean

  1. Copy the ACD file to the appropriate destination
  2. Rename the acd file to MyCompanyName.accdb
  3. Supply the MyCompanyName.accdb as the MS Access database to import files into in the MSBuildAccess project

So the ACD file shouldn't be imported along with the other files, rather it should be taken as the starting point. This became evident by looking at the actual msbuild task in the codeplex project.

In addition to the above steps, we also had a build error related to UIRibbon class in Ms Access. This was resolved by creating the reference file mentioned in the documentation of the MSBuildAccess project (see http://buildmsaccessdb.codeplex.com/documentation).

Now, we only need to resolve an out-of-memory issue when compiling our access database. This will most likely go away as we decrease the size of the Access project. It's our 'experience' that our Access solution is at the very limit of what Access is able to handle in terms of number of modules, reports, forms, etc. See these references for more info on that issue:

  • http://help.lockergnome.com/office2/Create-accde-file-error--ftopict802934.html
  • http://stackoverflow.com/questions/1300632/compiling-an-access-2007-accdb-into-accde
  • http://bytes.com/topic/access/answers/518438-cant-create-mde

这篇关于自动构建Access 2007数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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