I have been sent an Access file to open, I am using a Mac and need to open it in Python
import pyodbc
DBfile = '/Users/burfies1/Dropbox/pricing/data.accdb'
conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ='+DBfile)
cur = conn.cursor()
I get the following error
conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ='+DBfile) # user/password can be used
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'Microsoft Access Driver (*.mdb, *.accdb)' : file not found (0) (SQLDriverConnect)")
The best solution for me was to just install MDBTools
https://github.com/brianb/mdbtools
Then use mdb-export to create a csv
mdb-export data.accdb TABLE > output_file.csv
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With