10.07.2015 Views

Automate Microsoft Office with Python - Mil-OSS

Automate Microsoft Office with Python - Mil-OSS

Automate Microsoft Office with Python - Mil-OSS

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Access Automation• Simplest approach• install pyodbc library• treat Access file as normal SQL databasefrom pyodbc import connectfn = path_to_access_mdb_filedb = connect(r'DRIVER={<strong>Microsoft</strong> Access Driver (*.mdb, *.accdb)};DBQ=%s' % fn )cursor = db.cursor()cursor.execute(SOME_SQL_QUERY)for row in cursor.fetchall():blah ...GTRI_B-‹#›

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!