I've got an Access database located in m local files, which contains a .mdb (MS Access Database) file, with multiple rows and columns.
I want to work with that file in Python, via Google Colab (preferably), but can't find a way to properly open and read the file.
I installed pyodbc, imported it via import pyodbc as pyo, and added a connection string:
import pyodbc
conn = pyodbc.connect(r"Driver={Microsoft Access Driver (\*.mdb, \*.accdb)};DBQ=C:\\Users\\odero\\Documents\\dec\\Multi\\Database1.mdb;")
cursor = conn.cursor()
cursor.execute('select \* from OIL')
for row in cursor.fetchall():
print (row)
with the .mdb file being the original file of the dataset I am using, which contains the .mdb file.
However, when trying to connect it to the pyo by stating
cnn = pyo.connect(cnnstr)
I get:
Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'Microsoft Access Driver (*.mdb, *.accdb)' : file not found (0) (SQLDriverConnect)").
That's pretty much what I could do overall, I just don't know where to look/what to do.
Any help will be much appreciated.