views:

483

answers:

3

Is there a way to access a JET database from Python? I'm on Linux. All I found was a .mdb viewer in the repositories, but it's very faulty. Thanks

A: 

Probably the most simple solution:

  1. Download VirtualBox and install Windows and MS access in it.

  2. Write a small Python server which use ODBC to access the database and which receives commands from a network socket.

  3. On Linux, connect to the server in the virtual machine and access the database this way.

This gives you full access to all features. Every other solution will either limit the features you can use (for example, you won't be able to modify the data) or be pretty unsafe.

Aaron Digulla
Why the downvote?
Oddthinking
I didn't downvote it, but step 2 sounds substantially more complicated than any of the other options.
David-W-Fenton
+1  A: 

Install your distribution's packaged version of mdbtools, use mdb-export to export the Jet data to text files, import the data into a SQLite database, and have a combination of code and data that works in almost any computing environment you might get your hands on.

ΤΖΩΤΖΙΟΥ
+2  A: 

MDB Tools is a set of open source libraries and utilities to facilitate exporting data from MS Access databases (mdb files) without using the Microsoft DLLs. Thus non Windows OSs can read the data. Or, to put it another way, they are reverse engineering the layout of the MDB file.

Jackcess is a pure Java library for reading from and writing to MS Access databases. It is part of the OpenHMS project from Health Market Science, Inc. . It is not an application. There is no GUI. It's a library, intended for other developers to use to build Java applications.

ACCESSdb is a JavaScript library used to dynamically connect to and query locally available Microsoft Access database files within Internet Explorer.

Both Jackcess and ACCESSdb are much newer than MDB tools, are more active and have write support.

Tony Toews