如何在Access 2007中以编程方式或通过命令行创建Access 2003 MDE? [英] How do I create an Access 2003 MDE programmatically or by command line in Access 2007?

查看:64
本文介绍了如何在Access 2007中以编程方式或通过命令行创建Access 2003 MDE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个旧版Access 2003数据库文件,该文件必须保持该格式以保留其菜单和工具栏.我最近在构建环境中迁移到Access 2007,并将在Access 2007运行时中部署已编译的Access 2003程序.在Access 2003中,我可以使用命令行和生成首选项的.xml文件(不创建安装包)来编写使用Access开发人员扩展(WZADE.mde)创建MDE的过程的脚本. Access 2007开发人员扩展似乎没有提供类似的选项.我可以打包解决方案",但是它会创建一个accdr并将其埋入CD安装程序中.我曾尝试使用Docmd.RunCommand acMakeMDEFILe和Syscmd(603,mdbpath,mdepath)之类的编程选项,但它们在Access 2007中不再起作用.当然,我可以使用数据库工具">创建MDE"手动创建MDE,但这是无法编写脚本的据我所知.

I have a legacy Access 2003 database file that must remain in that format to preserve its menus and toolbars. I have recently moved to Access 2007 in my build environment and will be deploying the compiled Access 2003 program with the Access 2007 runtime. In Access 2003, I could script the process of creating an MDE with the Access Developer Extensions (WZADE.mde) using the command line and an .xml file of build preferences (without creating an install package). The Access 2007 developer extensions do not seem to offer a similar option. I can "Package a Solution", but it creates an accdr and buries it in a CD installer. I've tried programmatic options like Docmd.RunCommand acMakeMDEFILe and Syscmd(603, mdbpath, mdepath) but they no longer work in Access 2007. Of course, i can manually create an MDE using Database Tools>Create MDE, but that is no scriptable as far as I can tell.

推荐答案

尝试一下:

Dim objAccess As Object
'Create the Access Automation object
Set objAccess = CreateObject("Access.Application")
'Now call the undocumented function...
objAccess.SysCmd 602, cstr(strPathSourceMdb), cstr(strPathDestinationMdb)
Set objAccess = Nothing

此处是一个链接(具有更多未公开的功能)

Here is a link (with more undocumented features).

这篇关于如何在Access 2007中以编程方式或通过命令行创建Access 2003 MDE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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