Reputation: 1055
I have my database in msacess 2000 .mdb format which I downloaded from the net and now I want to access that database from my program which is a python script. Can I call tables from my programs?? it would be very grateful if anyone of you please suggest me what to do
Upvotes: 2
Views: 6829
Reputation: 110746
For whoever pass by, another option is using mdbtools - which can export the MDB database to a re-usable format, like CSV- check: http://mazamascience.com/WorkingWithData/?p=168
If you don't need to update the mdb file, just to import legacy data, doing something akin to the recipe on the link above is easier than get pyodbc working properly and, it does not require access to a Windows machinne
Upvotes: 4
Reputation: 54342
If you work on Windows, then you can use ODBC and use odbc
module (ActiveState Python has it by default, this is part of win32 extensions), or pyodbc
module. Have a look at answers to: How to connect pyodbc to an Access (.mdb) Database file
If you use Jython you can use JDBC-ODBC bridge:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
db = DriverManager.getConnection('jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\\Nwind.mdb', usr, passwd)
Upvotes: 2
Reputation: 3827
Create an ODBC DSN wit hthis MDB. Python can access ODBC data sources.
Upvotes: 0