3

I am looking for a way to mimic the "Get External Data" in Access 2007 (accdb) using Python. I am trying to import data from a MDB to a ACCDB. Basically I don't want to do this manually each time, but incorporate it into my Python workflow.

HansUp
  • 95,961
  • 11
  • 77
  • 135
dklassen
  • 131
  • 4

1 Answers1

0

Assuming you are on a Windows-machine:

You can automate the "Get External Data"-task by using VBA. Dive into the documentation of the TransferX (TransferText...) methods of the DoCmd-Object in VBA. So before using Python, I would recommend you should program a working VBA-solution for your task.

After that, you can try to use the Win32 Extensions for Python. These offer some COM-Interop classes you could use. Probably this piece of code in Python would be the starter for you:

import win32com.client
acc = win32com.client.Dispatch("Access.Application")
...

With this at hand you should be able to transfer your VBA-Code to Python.

AndyG
  • 39,700
  • 8
  • 109
  • 143
Benjamin Brauer
  • 368
  • 1
  • 5
  • 19