将MS Access数据库对象序列化为文本文件 [英] Serialize MS Access Database Objects to Text File(s)
问题描述
那里有一些代码可以让我序列化MS Access MDB文件中的所有对象.
Is there some code out there that lets me serialize all the objects in an MS Access MDB File.
所有对象(如表定义,表数据,查询定义,报表定义,VB模块)应写入一个或多个文本文件.
All the Objects like Table definitions, Table Data, Query defintions, Report definitions, VB Modules should be written to one or multiple text files.
不必撤消该操作(但会很高兴).我想将文本文件放入VCS,以便跟踪更改和文档.
It is not necessary to reverse the operation (but would be nice to have). I want to put the text files to a VCS so I can track changes and document.
推荐答案
- 从/导入/导出Access表单,模块或宏 文本文件,请使用未记录的文件 的LoadFromText/SaveAsText方法 应用程序对象. (看来您可以对查询和报告对象使用相同的方法)
- 对于表,可以使用DoCmd对象的transferDatabase方法.当心.这样,您将失去表结构,并且比较文本文件的内容将非常危险.我建议您开发自己的表结构比较工具.我想网上也可以买到一些软件(用于MS Access表比较的Google)
- 要比较与文本文件相同的表单/模块/宏的不同版本,请使用诸如文件比较工具之类的软件
- To import/export Access forms, modules or macros from/to text files, use the undocumented LoadFromText/SaveAsText methods of the application object. (it seems you can use the same methods with query and report objects)
- For tables, you can use the transferDatabase method of the DoCmd object. Be careful. By doing so you will loose the table structures and comparing text files content will be very hazardous. I'd advise you to develop your own tool for table structure comparison. I guess some pieces of software are also available on the net (google for MS Access table comparison)
- To compare different versions of the same forms/modules/macros as text files, use a softare such as Files Compare Tool
使用SaveAsText命令导出时,您将必须编写一些清理"代码,以通过(例如)抑制行号或内部访问引用来简化文件比较.
You will have to write some 'cleaning' code when exporting with the SaveAsText commande, in order to ease file comparison by (for example) suppressing line numbers or internal access references.
也请检查以下链接:
How do you use version control with Access development?
这篇关于将MS Access数据库对象序列化为文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!