title: Unable to run MS Access macros using Python and pyodbc
body: <p>I am trying to run a msaccess macro in python and having trouble with running the query. I am using pyodbc to connect to the mdb.</p>
  <pre><code>conn_str = (
     r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};'
     fr'DBQ={mdb_path};'
  )
  conn = pyodbc.connect(conn_str)
  cursor = conn.cursor() 
  </code></pre>
  <p>The above code connects to the .mdb and appears to be successful in connecting, but I am unsure of how to run the macro now.</p>
  <pre><code>cursor.execute(f'exec {macro}')
  </code></pre>
  <p>I've tried the above and get the error -
  ('42S02', &quot;[42S02] [Microsoft][ODBC Microsoft Access Driver] The Microsoft Access database engine cannot find the input table or query 'macro_run_vb'. Make sure it exists and that its name is spelled correctly. (-1305) (SQLExecDirectW)&quot;)</p>
  <p>macro_run_vb is the name of the macro so I know that its not a problem of it not finding the macro. Has anyone had a similar issue with running macros in python?</p>