Hello I've been searching around and couldn't find anything up to date in this topic.
I would like to create a new .mdb file using pythons library pyodbc.
I've tried so many different ways and can never succeed. The main problem for me is to connect to a database that yet does not exist.
import pyodbc
DRV = '{Microsoft Access Driver (*.mdb, *.accdb)}'
PWD = ''
con=pyodbc.connect('DRIVER={};DBQ={};PWD={}'.format(DRV,'./'+new_path+'.mdb',PWD))
I've tried inserting a
f=open(new_path+'.mdb','a')
f.close()
in order to create a mdb file before trying to connect but could not succeed as well, it says that the file is corrupted.
pip install --user msaccessdb