从MDB / ACCDB转换为XLS / XLSX [英] Conversion from MDB/ACCDB to XLS/XLSX

查看:556
本文介绍了从MDB / ACCDB转换为XLS / XLSX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个项目,我希望将文件夹中的所有mdb文件转换为C#或VB中的xls文件。

这里用户将选择文件夹,然后选择所有mdb文件文件夹应该转换为具有相同名称的excel文件。

另外mdb文件可以包含许多no。表和我想要mdb文件中的每个表必须转换为与表的名称相同的不同表。

请帮我一些代码。



谢谢!

I am working on a project where I want to convert all the mdb files in a folder to xls files in C# or VB.
Here user will select folder and then all the mdb files in that folder should get converted to excel files having same name.
Also mdb file can contain many no. of tables and and I want each table in mdb file must be converted to different sheet having same name as that of table.
Please help me with some piece of code.

Thanks!

推荐答案

数据库和电子表格不是一回事。通常,没有从数据库到电子表格的无损转换(反之亦然);你将丢失查找信息,约束,保存的查询/程序(如果Access支持它们)和类型安全。



你能做的最接近的就是提取每一张桌子(从表中选择*到DataTable中,然后使用interop或Aspose或类似的第三方组件将其写入Excel电子表格。这似乎是你已经在做的事情,所以你需要更清楚你的问题是什么,以获得详细的答案。
A database and a spreadsheet are not the same thing. There is, in general, no lossless conversion from a database to a spreadsheet (or vice versa, in fact); you will lose lookup information, constraints, saved queries/procedures (if Access supports them) and type safety.

The closest you could do would be to extract every table (select * from table) into a DataTable and then write that to an Excel spreadsheet using interop or Aspose or a similar third party component. That seems to be what you're already doing so you need to be more clear about what your problem with that approach is to get a detailed answer.


这篇关于从MDB / ACCDB转换为XLS / XLSX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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