views:

2568

answers:

8

Is there any way to create an Access / Jet database from within Linux?

I'm trying to feed data from a linux application server (mysql backend) and have not found any tools that let me do this - it seems there should be something.

If I can't create a database, is there a way to insert into an existing Access database file from within Linux?

CLI tool, wrapper to SQL command file, C library, Ruby library, anything?

Thanks.

+3  A: 

EasySoft have an ODBC driver that could be used to insert data into an existing MS Access database.

If you can, I would swap Access for SQL Server Express (free download), then you can use the FreeTDS ODBC driver to talk to it from Linux or one of the other available commercial ODBC drivers to access MS SQL Server from Linux.

Mitch Wheat
Second paragraph is very very good advice (imo).
Ali A
Does SQL Server Express run on Linux? If so, you're just swapping one Windows database for another. If you're running Linux, using Linux databases!
David-W-Fenton
Linux can talk to SQL server via ODBC and TCP sockets. But an Access ODBC driver would essentially be an entire implementation of JET, and Linux doesn't have one of those. So an SQL Server would actually work here.
apenwarr
+1  A: 

might be a dumb question, but why access? I have to assume that this data needs to make its way over to Windows at some point? There might be other ways of solving this problem. if the access db is going to be used in house, you can setup a connection to MySQL from Access running on windows and get the data that way.. if the data file is going to be disconnected, you could try creating a comma-separated text file with the data, but give it a .xls extension - on a windows machine this will cause it to open in Excel, which many users would be ok with.

basementjack
A: 

We're trying to feed data into a third party application. Unfortunately it expects an Access database (which we have the schema for) and only an Access database.

I was hoping that there was a way I could write out the database from our linux application (like you would a SQLite database) but am having a hard time finding a tool like that.

catwood
First off, Jet is only reliable if it's stored on authentic Windows file system. That means you need a Windows machine. Once you have that, you should be able to set up a System DSN for other machines to communicate with it, as long as you have a Linux ODBC driver for Jet.
David-W-Fenton
A: 
  1. If you want to create an access database (mdb file) from scratch, you'll need some Microsoft Office dll, so I think you can forget it.

  2. If your idea is to insert/manipulate data in an Access mdb file, you'll need a specific driver for the kind of connexion you want to use. I think your choice will be basically between ODBC and OLEDB. You can then use this connexion to modify your data (INSERT, UPDATE, DELETE), extract it (SELECT) of even manipulate your database structure through DDL instructions (CREATE, DROP, etc).

Philippe Grondier
A: 

Why not use a web service? You could run an ASP (or whatever) service on a Windows machine, and it could construct the required .mdb file using ODBC. Then your Linux app could upload the raw data and receive an .mdb in response.

Or alternatively, just run your entire script on Windows. You can install cygwin and/or ActiveSate perl and access Windows ODBC drivers (including Access) from there.

apenwarr
A: 

Is it feasible for you to edit your access database in windows so that you use linked tables which are then linked to an external Text File, XML File, HTML Document, etc.?

In Office2007 use the "External Data" tab and then select 'Text File', 'XML File', etc.. Just make sure that you select the radio button 'Link to the data source by creating a linked table.' If you first remove the existing table and create a linked table with the same name you just might fool your application into viewing the text file through Access as a proxy.

This way you could update the external file easily from your linux application and your application should see that data when it interacts with the access database.

nvuono
A: 

You can run Access 2002 on the Linux system using Crossover Office, and automate it from a script. (For example, you can write some VBScript and execute it using wscript.exe under CrossOver.)

Lately, I'm doing this myself for some databases and it works great. Email me if you need some help setting it up.

apenwarr