How to access ODB files in Python 2.7

梦想的初衷 提交于 2020-01-02 03:53:26

问题


I want to access an ODB file (made with LibreOffice Base) in Python and extract a table for further use. The ODB contains several tables, one relation design and several forms.

Is it possible to achieve this without using any SQL?

Edit: Since it seems overcomplicated to parse this format on my own, i'll consider using a proper HSQLDB engine.

What python module accesses via HSQL (like sqlite3 for SQLite does)?


回答1:


You can consider Python Uno API that comes with OpenOffice. There are several Python examples to interact with the API, including one with the sample database

There is also this SO question where it is explained how to use uno with LibreOffice.




回答2:


The default form of ODB file contains an HSQLDB database. You can extract this database then access it using HSQLDB software and any client that can connect to HSQLDB.

Instructions on how to extract the database can be found here: http://programmaremobile.blogspot.co.uk/2009/01/java-and-openoffice-base-db-through.html



来源:https://stackoverflow.com/questions/11370237/how-to-access-odb-files-in-python-2-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!