如何导出Access 2010数据宏 [英] how to export Access 2010 data macros

查看:163
本文介绍了如何导出Access 2010数据宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将Access数据宏从测试数据库传输到生产数据库.有人知道该怎么做吗?

I need to transfer Access data macros from my test db to my production db. Anybody know how to do that?

我知道将表从一个accdb转移到另一个accdb也会转移数据宏,但是在我的情况下这不是一个选择.我也知道我可以在生产accdb中手动重新创建它们,但这使我容易出错,并且需要比脚本传输方案更长的时间关闭生产数据库.

I know that transferring tables from one accdb to another will also transfer the data macros, but that's not an option in my case. I also know I can recreate them manually in the production accdb, but that leaves me open to errors and requires taking the production database down for a longer time than would a scripted transfer scenario.

如果我只需要这样做一次,这没什么大不了的,但是在开发项目的过程中,我将需要做很多次.

If I only had to do this once it wouldn't be such a big deal, but I'll need to do it many times over the course of a development project.

我尝试将表导出到xml,但是不包含数据宏.

I've tried exporting the tables to xml, but the data macros are not included.

请注意,我在这里询问的是Access 2010 数据宏,而不是常规的Access宏.

Please note that I'm asking about Access 2010 data macros here, not regular Access macros.

推荐答案

我在这里没有很好的答案.

I don't have a great answer here.

但是,过去我经常写一本关于表更改的日志",然后在现场简单地使用它.

However, in the past I often made a "log book" of changes to tables and then simple used that on site.

请注意,您可以剪切+粘贴宏代码.并将代码另存为XML.

Do note that you can cut + paste macro code. And the code saves as XML.

例如,此更新后的表触发在Access中如下所示:

For example, this after update table trigger looks like this in Access:

如果剪切了上述内容(ctrl-a,ctrl-cc),则可以将其粘贴到记事本中.实际上,您甚至可以在Visual Studio或任何xml编辑器中将其粘贴/打开,然后您会看到以下内容:

If you cut out the above (ctrl-a, ctrl-cc),, then you can paste that into a note pad. In fact you can even paste/open it in visual studio or any xml editor, and you see this:

因此您可以剪切+粘贴这些宏.

So you can cut + paste out of those macros.

如上所述,因此在过去,我经常记录更改的日志".

As noted, thus in the past I often kept a "log" of changes.

因此,如果我在异地工作,并且修改了2个代码模块,4个表单和2个报表,那么我会有一些更改日志.我将在此表中键入更改了什么对象.

So if I was working off site and I modified 2 code modules, 4 forms and 2 reports, then I had a little log of changes. I would type into this sheet what object was changed.

当我到达现场时,我快速浏览该工作表,就知道要导入3-5个对象,而这样的导入仅需几分钟即可完成.

When I get on site, then I quick glance at that sheet and I know to import the 3-5 objects and such a import is only a few minutes tops.

但是,使用表触发器和存储过程,您可以复制的内容更多而已.

However, with table triggers and store procedures, you could have more then just a few to copy.

我会做以下两件事之一:

I would either do one of two things:

使用日志提示和

a)取消发布开发版本,并将其随身带到您的工作站点.然后,您导入新的表格,报告等. 对于触发代码,您可以在两个应用程序之间剪切+粘贴.

a) Un-publish the development version and bring that with me to your working site. You then import new forms, reports etc. For trigger code, you cut + paste between the two applications.

b)对触发器进行更改时,然后剪切+粘贴到记事本文档中并将其放置在目录中.在现场时,只需拿起每个记事本,剪切并粘贴到生产中,然后将记事本项移动或复制到完成"文件夹中即可.

b) When you make a change to a trigger, then cut + paste into a note pad doc and place them in a directory. When on site, simply take each notepad, cut + paste into production and then move or copy the notepad item into a "done" folder.

以上内容肯定不理想.再过去,我并不总是拥有编写表更改脚本的代码,并且使用一点日志表就可以很好地工作.

The above is certainly less than ideal. Then again in the past I not always had code to script out a table change, and using a little log sheet worked quite well.

因此,在过去,我经常记下此类表被修改的记录,而我必须添加此类表的列.

So in the past I often just written down that such and such table was modified and I have to add such and such column.

因此,如果要剪切+粘贴宏代码作为xml到单独的小文档中,还是要剪切+粘贴从开发到生产的过程,这真的是您的选择.

So it really your choice as to if you want to cut + paste out the macro code as xml into separate little documents, or cut + paste right out of development into production.

我确实认为,如果您在不同的位置工作,那么我认为最好取消发布开发版本,并随身携带(我想您知道/可以重新制作一个未发布的版本).网络应用程序.)

I do think if you working in differnt location, then I think it likely best to un-publish the development version, and bring that with you (I assume you know/realaize that you can make a un-published copy of a web application).

因此,可以很容易地导入表单,代码模块,宏等(删除表单等,然后从未发布的副本中导入).

So the forms, code modules, macro's etc can just be imported rather easy (you delete the forms etc, and just import from that un-published copy).

但是,对于表代码?您必须一次从未发布的副本中剪切+粘贴一次到某个暂存区域,或者按照说明在应用程序之间剪切+粘贴.

However, for the table code? You have to cut + paste from that un-published copy one at a time into some staging area, or as noted cut + paste between the applications.

另存为"文本可能会在这里起作用,但我还没有时间制定出更好的解决方案.

There is the possibility that save-as text might work here, but I not yet had the time to cook up a better solution.

顺便说一句,在上面我假设了一个Web服务数据库,但是该建议仍然适用于非Web Access数据库.

By the way, in above I assumed a web services database, but the advice still applies to non web Access databases.

这篇关于如何导出Access 2010数据宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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