Save MS ACCESS attachments with python
Save MS ACCESS attachments with python This seemed pretty simple but it wasn't. The goal was to create an offline database with forms so Users could fill data that will later be put into reports. The catch is that this reports have complex formating and pictures so my idea was to pull data from MS ACCESS (can create tables and forms that manage attachments pretty well) and insert it into word templates using doctpl. My problem is that I can't manage to pull the attached pictures in the ACCESS tables. I've tried using win32com.client like this: import win32com.client daoEngine = win32com.client.Dispatch('DAO.DBEngine.120') db = r"C:UsersPDocumentsdb.accdb" daoDB = daoEngine.OpenDatabase(db) query = "SELECT picture FROM Galery WHERE ID=13" daoRS = daoDB.OpenRecordset(query,2) daoRS.Edit() daoRS.Fields["picture"].SaveToFile("C:UsersPCA037Documents\") daoDB.Close() But it returns error: (-2147352567, 'Exception occurred.',...