import win32com. Client
Engine=win32com. Client. Dispatch (" DAO. DBEngine. 35 ")
Db=engine. The OpenDatabase (r "c:/temp/mydb. MDB)
Rs=db. OpenRecordset (" customers ")
Db. The Execute (" delete * from customers where balancetype="overdue" and name='bull' ")
Error:
E: \ Python_Project \ pythoncode \ venv \ Scripts \ python exe E:/Python_Project pythoncode/example_pywin32 py
Traceback (the most recent call last) :
The File "E: \ Python_Project \ pythoncode \ venv \ lib \ site - packages \ win32com \ client \ dynamic py", line 89, in _GetGoodDispatch
IDispatch=pythoncom. Connect (IDispatch)
Pywintypes.com _error: (- 2147221005, 'string' invalid class, None, None)
During handling of the above exception, another exception occurred:
Traceback (the most recent call last) :
The File "E:/Python_Project pythoncode/example_pywin32 py", line 6, the in & lt; module>
Engine=win32com. Client. Dispatch (" DAO. DBEngine. 35 ")
The File "E: \ Python_Project \ pythoncode \ venv \ lib \ site - packages \ win32com \ client \ set py", line 95, Dispatch in
Dispatch, the userName=dynamic. _GetGoodDispatchAndUserName (dispatch, userName, CLSCTX)
The File "E: \ Python_Project \ pythoncode \ venv \ lib \ site - packages \ win32com \ client \ dynamic py", line 114, in _GetGoodDispatchAndUserName
Return (_GetGoodDispatch (IDispatch, CLSCTX), userName)
The File "E: \ Python_Project \ pythoncode \ venv \ lib \ site - packages \ win32com \ client \ dynamic py", line 91, in _GetGoodDispatch
IDispatch=pythoncom. CoCreateInstance (IDispatch, None, CLSCTX, pythoncom IID_IDispatch)
Pywintypes.com _error: (- 2147221005, 'string' invalid class, None, None)