将MSAccess应用程序中的对象导出为文本对象,然后导入到新的MDB中 [英] Export Objects in MSAccess Application to Text Objects, and Import Into A New MDB

查看:99
本文介绍了将MSAccess应用程序中的对象导出为文本对象,然后导入到新的MDB中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将所有MDB对象从我的MDB导出到文件夹中的文本文件,然后使用一些VBA代码将这些文本文件作为新的Access对象导入到全新的MDB中.

I need to export all of the objects from my MDB to text files in a folder, and them import those text files as fresh Access objects into a brand new MDB, using some VBA code.

有人有这个的源代码吗?我知道它存在于某个地方,此刻我暂时找不到它.

Does anyone have the source code for this? I know it exists out there somewhere, I just can't find it at the moment.

推荐答案

损坏的对象在损坏的Microsoft Access MDB中

如果对象已损坏或发生其他异常行为,则记录很少的SaveAsTextLoadFromText可能会有所帮助.

The little documented SaveAsText and LoadFromText may help if an object is corrupted or otherwise behaving weirdly.

在调试/立即窗口中输入:

At the debug/immediate window type:

Application.SaveAsText acForm,"MyForm","c:\ form.txt"

Application.SaveAsText acForm,"MyForm","c:\form.txt"

您可以将文件加载到新的MDB中.

You can load the file into a new MDB.

Application.LoadFromText acForm,"MyForm","c:\ from.txt"

Application.LoadFromText acForm,"MyForm","c:\from.txt"

示例代码位于 http://www.datastrat.com/Code/DocDatabase.txt用于将所有对象保存在MDB中.

Sample code at http://www.datastrat.com/Code/DocDatabase.txt for saving all objects in an MDB.

这篇关于将MSAccess应用程序中的对象导出为文本对象,然后导入到新的MDB中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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