在 Objective-C 中读取 MS Access .MDB 数据库
我正在探索将 ATCS Monitor 从 Windows 移植到 iPad 和 Mac OS X。ATCS Monitor 使用 Microsoft JET 4.0 从 Access MDB 文件读取数据。是否有可以读取 MDB 文件的 Objective-C 库,或者我是否需要自己构建(很可能基于 MDB 工具 )?
I am exploring porting ATCS Monitor from Windows to the iPad and Mac OS X. ATCS Monitor uses Microsoft JET 4.0 to read data from Access MDB files. Is there an Objective-C library that can read MDB files, or do I need to roll my own (most likely based on MDB Tools)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会将这些 MDB 文件导入到 MySQL DB(因为 OSX 无论如何都无法真正读取这些文件),并让您的 OSX/Ipad 客户端直接访问该 DB 层(或提供对这些文件的访问的 Web 服务)
I would import those MDB files to a MySQL DB (since OSX cannot really read those anyway), and have your OSX / Ipad client directly access that DB layer (or a web service providing access to those)
为什么 iPad/OS X 版本的数据需要是 Access .mdb 文件?
我不知道 ATCS 系统的内部结构如何工作,但我假设可以通过某种类型的 Web 服务获取数据。如果 .mdb 文件仅用于在本地计算机上存储数据,那么您的 Objective-C 实现可以使用任何本地数据存储系统来执行相同的操作。
我无法想象 .mdb 文件以任何方式暴露在应用程序外部的场景。该程序是否下载 .mdb 文件然后读取数据?如果是这样的话,那么编写您自己的 Web 服务将服务器上的数据转换为另一种可以更好地被您的 Objective-C 代码使用的格式就很容易了。
编辑:因此用户正在相互共享 .mdb 文件。我仍然认为最好的选择是使用 Web 服务,将 .mdb 文件转换为更容易通过 iOS/Mac 使用的格式。为了让 Objective-C 版本的应用程序导入 .mdb 文件,它们需要连接到 Internet,至少与 Web 服务转换数据所需的时间一样长。
编辑 2:也许您已经发现了应该满足的需求。如果没有用于共享此数据的中央存储库,那么您可以创建这样的存储库并鼓励雅虎组中的用户使用它。让人们可以非常轻松地从 MDB 文件上传和导入数据。除了桌面界面之外,还创建一个 Web 界面。汇总所有单独上传的数据。有很多可能性!
我理解在用户所在的地方与他们会面,但对我来说,这也是一个很好的机会让这个特定的用户社区进入 21 世纪。
Why does the data need to be an Access .mdb file for the iPad/OS X versions?
I don't know how the internals of the ATCS system work, but I would assume that the data is available via some type of web service. If the .mdb file is only used for storing data on the local machine, then your Objective-C implementation could use any local data storage system to do the same thing.
I just can't imagine a scenario in which the .mdb file was exposed in any manner external to the application. Does the program download an .mdb file and then read the data? If that's the case, then it would be easy enough to write your own web service that converts the data on the server to another format that could be better consumed by your Objective-C code.
Edit: So users are sharing .mdb files with each other. I still think your best bet would be a web service that converts the .mdb file into a format that's more easily consumed via iOS/Mac. In order for the Objective-C versions of the app to import an .mdb file, they'd need to be connected to the Internet at least for as long as it took for the web service to convert the data.
Edit 2: Maybe you've found a need that you should fill. If there is no central repository for sharing this data, then you could create such a repo and encourage users in the Yahoo groups to use it. Make it super easy for someone to upload and import their data from MDB files. Create a web interface in addition to the desktop interface. Aggregate the data from all the individual uploads. There are lots of possibilities!
I understand meeting users where they are, but it also sounds to me like there's a great opportunity to enable this particular user community to move into the 21st century.
没有用于读取 MDB 文件的开源 Objective-C 库。
以下是我所知道的在 Mac / iPhone 上读取 MDB 文件的所有方法:
1) MDB 工具:0.7版本很好用。有一个非常有用的 C API,尽管文档很少。支持读表。已获得 LGPL 许可,因此在 iOS 上使用它可能不合法,但在 Mac 上应该不成问题。
2) Actual ODBC 驱动程序(专有):仅适用于 Mac。也许您可以找到与制造它们的公司的一些许可协议。
3) Jackcess,最初是 MDB Tools 到 Java 的端口,但他们添加了写入支持。可能只在 Mac 上有用。
4) HXTT Access Pure Java JDBC:一个专有的Java库,用于读写Access数据库。这很有趣,因为公司名称 Impathic 在他们的 Mac(我相信是 iPhone)应用程序中使用了它。他们完全疯了,他们在应用程序包中包含了完整的 Java 运行时,这样他们就可以在 App Store 上分发 Java 应用程序,但它似乎可以工作(尽管有一些错误)。
5)我自己的专有库。我(从头开始)编写了一个 Objective-C 库来读取 Access 数据库,并在我的 Mac 和 iPhone 应用程序中使用它。如果您有兴趣获得许可,请与我联系。
There is no Open Source Objective-C library for reading MDB files.
Here are all the ways I am aware of for reading MDB files on the Mac / iPhone:
1) MDB Tools: Version 0.7 is quite usable. Has a quite usable, allthough poorly documented C API. Supports reading tables. Is licensed under LGPL, so it might not be legal to use it on iOS, but shouldn't be a problem on Mac.
2) Actual ODBC drivers for Access (proprietary): Only for the Mac. Maybe you can find some licensing agreement with the company making them.
3) Jackcess, originally a port of MDB Tools to Java, but they added write support. Probably only useful on the Mac.
4) HXTT Access Pure Java JDBC: A proprietary Java library for reading and writing Access databases. It's interesting because a company name Impathic uses it in their Mac (and I believe iPhone) apps. They are completely crazy and they include a full Java runtime in their app package so they can distribute a Java app on the App Store, but it seems to work (albeit with a few bugs).
5) My own proprietary library. I wrote an Objective-C library (from scratch) for reading Access databases and I use it in my Mac and iPhone apps. If you are interested in licensing it, contact me.