从命令行构建Access可执行文件? [英] Build an Access executable from command line?

查看:255
本文介绍了从命令行构建Access可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个仍在生产中的旧版Access应用程序.我至少希望有一个自动化的版本.您可以从命令行构建访问exe吗?

We have a legacy Access application that is still in production. I would like to at least have an automated build for it. Can you build access exe's from the command line?

更好的是,有没有机会,将有一个Access的MSBuild目标?

Even better, there wouldn't by any chance, be an MSBuild target for Access would there?

推荐答案

a = CreateObject("Access.Application")
If a.SysCmd(603, PATH_TO_BXB_FILE, PATH_TO_BXE_FILE) = 0 Then
    MsgBox("Fail to compile to MDB file")
End If

syscmd <的603参数/a>未记录.它将由于多种原因而失败,例如,在VBA下运行,如果不使用MS Access的单独实例,它将失败.在中,其他失败的原因如下:

The 603 argument of syscmd is undocumented. It will fail for a number of reasons, for example, running under VBA it will fail if you do not use a separate instance of MS Access. In this, other reason to fail are given as:

  • 在单独的Access数据库(与解决方案数据库分开)中运行的VBA代码中使用时;
  • 关闭解决方案数据库时;和
  • 解决方案数据库中的VBA代码中没有语法错误时.
  • when it's used in VBA code running in a separate Access database (separate from the solution database);
  • when the solution database is closed; and
  • when there are no syntax errors in the VBA code in the solution database.

请注意,即使创建成功,生成的mde或accde也可能无法在另一台计算机上运行.在大多数情况下,我发现Access 2010是最能容忍的,但是,您最终会遇到麻烦的安全警告.

Note that even if the creation succeeds, the resulting mde or accde may not work on another machine. For the most part, I have found Access 2010 to be the most tolerant, however, you will end up with a bothersome security warning.

这篇关于从命令行构建Access可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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