views:

695

answers:

2

Is there a library for using MS Access database in python? The win32 module is not as easy as the MySQL library. Is there a simpler way to use MS Access with Python?

+2  A: 

Depending on what you want to do, pyodbc might be what you are looking for.

stephan
thanks for it dude. I feeling convenient with this :)
Vicky
+2  A: 

I don't think win32 is hard. Try use its odbc module. Example of code working with ODBC and PostgreSQL database:

import odbc

def get_pg_ver(db_alias):
    connection = odbc.odbc(db_alias)
    try:
     cursor = connection.cursor()
     cursor.execute('SELECT version()')
     for row in cursor.fetchall():
      print row[0]
    finally:
     connection.close()

get_pg_ver('odbc_name/user/passwd')

This is very similar for every db driver I used in Python and Jython (I work with PostgreSQL, Oracle and Informix).

Michał Niklas
Agreed: 'odbc' works fine with M$ Access.
Adam Bernier
thanks a lot dude
Vicky