I'm trying to open a Access database using Python. All I want it to do is open the .accdb
file, as I have a macro that auto-runs. The only code I can find is this:
import win32api
import time
from win32com.client import Dispatch
strDbName = 'Empactis Delete Cloud v1.accdb'
objAccess = Dispatch("Access.Application")
objAccess.Visible = True
objAccess.OpenCurrentDatabase(strDbName)
objDB = objAccess.CurrentDb()
objAccess.run('test')
objAccess.Application.Quit()
My first issue is, I'm not running a macro from Python so I'm not sure which parts to remove and which parts to keep.
Second issue is, I cannot find win32api as a module anywhere. I have Python 3.8 and it's not an included module, PIP also can't find it to install.
There must be a simple way of just opening an MS Access file?