0

I tried to read ms access data base over the network using this code -

cnxn = pyodbc.connect('DRIVER={FreeTDS};DBQ=\\http:\\10.0.0.2\NetworkSharedFolder\Misure.mdb;')
cursor = cnxn.cursor()
cursor.execute('SELECT Id,Data, Ora, Esito, Res_Esito, Rot_Esito, Rig_Esito, Sur_Esito from Misure WHERE ID = '+str(ids))
rw = cursor.fetchone()

I have installed FreeTDS, pyodbc and unixODBC. The error it gives is -

('08001', '[08001] [unixODBC][FreeTDS][SQL Server]Unable to connect to data source (0) (SQLDriverConnect)')
Inderpal Singh
  • 270
  • 2
  • 8
  • 24
  • 1
    Does anything in the FreeTDS documentation suggest that it will work with Access databases? I don't think it will. My understanding is that it is only intended to be used for connecting to Microsoft SQL Server and Sybase databases. – Gord Thompson Aug 18 '14 at 14:18
  • @GordThompson I found it in driver page of http://www.unixodbc.org/ But they say that download free trail version from EasySoft website. But they do suggest same for other databases like sybase. What does it suggests? And what about Gmdb2? I found it here http://mdbtools.sourceforge.net/install/c98.htm – Inderpal Singh Aug 19 '14 at 04:59

1 Answers1

0

I don't think you will find anything that lets you usefully query an Access database on Linux.

I'd recommend BullZip's Access to MySQL. It's a Windows program that will let you convert an Access database to MySQL. I've previously run it inside a virtual machine to export a database to an SQL dump, and then imported it into MySQL to get something I can use sensibly.

chiastic-security
  • 20,430
  • 4
  • 39
  • 67
  • Does it converts ms access to mysql on the go? because my MS Access database keeps updating on regular basis. And i want to read that database when its updated and read all the new readings. – Inderpal Singh Aug 19 '14 at 04:55
  • No, it doesn't. You're not going to be able to do that. Access is a proprietary format that isn't designed for other programs to be able to make arbitrary calls to. If you want a database on your Windows machine, and then to be able to get to it from your Linux machine, you'll need to change Access to something else on the Windows side (e.g., MySQL). – chiastic-security Aug 19 '14 at 14:04