Connecting to Access Database from Linux

Connecting to access database from linux

It's uncommon for an application running on Linux to access an MS Access database or use ODBC. ODBC is a windows technology. There are some options for linux, but it's not a common scenario.

As you've discovered, there are no Access ODBC drivers on your linux machine, so the JDBC-ODBC bridge fails. You might be able to install a suitable ODBC driver, but I don't know of any that are free or open-source. The defacto ODBC option for linux is:

  • http://www.unixodbc.org/

A commercial driver for Access based on UnixODBC:

  • http://www.easysoft.com/products/data_access/index.html

A type 4 JDBC driver that can supposedly connect to Access databases:

  • http://www.hxtt.com/access.html

I don't have personal experience with any of these. The type 4 JDBC driver would be ideal, but I'd be skeptical that it works as perfectly as advertised.

(I am sure you have reasons, but I have to wonder why you are using an Access database if you plan on deploying to Linux machines. I believe the only good reason to have a Java application use an Access database is if it's an existing Access application with custom programming used for purposes beyond the Java application. Otherwise, there are a number of better options. Also consider that if your main reason for using Access is just so you can use Access as a user-friendly GUI tool for forms & reporting, you could still store the data in less restrictive database (Derby, SQLLite, MySQL, PostgreSQL, MS SQL Server, etc) and then connect via ODBC from Access to the database.) This would allow you to deploy your Java application on linux, your database wherever makes most sense, and still use Access to connect to the database from windows. I've done this a number of times.)

Unable to connect to Access database from Linux

It looks like your trying to run code written for Windows on Ubuntu.
It looks like the path name is not a POSIX style path.

You will need to configure linux odbc properly - or just install python on Windows and run your code there...

As far as I know there is no free linux ODBC driver for accdb files. You would likely have to convert the database, use commercial software, or access the DB from Windows.

Connect to remote MS Access database from Linux Server using PHP

Yes, it's possible. I've done it using ODBTP, which took advantage of the ODBC driver on the (Windows) machine that hosted the Access database file.

It's also theoretically possible to use an ODBC driver on the Linux server to read an Access database on a Windows networking share if the Linux box can "see" it. However, I've never had very good luck with Access ODBC on Linux so I wouldn't recommend spending too much time trying to get it working.



Related Topics



Leave a reply



Submit