Python-Oracle connection problem with Pyodbc

Tried connecting to Oracle database using Pyodbc:

try:
    db_connection = pyodbc.connect('DSN=OraDev; PWD=%s' % Key.dbKeys['password'])
except pyodbc.Error, err:
        print >> debug_file, "Database connection failed: %s" %err 
        sys.exit()

      

and it keeps giving me this error message:

'[IM014] [Microsoft] [ODBC Driver Manager] Specified DSN contains an architecture mismatch between driver and application (0) (SQLDriverConnect)

So I'm wondering if the culprit is that I don't have "matching" components. I currently have:

  • Python 2.7 32bit
  • Pyodbc 3.0.6 win32-py2.7
  • Oracle ODBC Driver: 32bit
  • Windows Server 2008 64bit
  • Oracle 11.2.0 64bit

Is there something wrong with the versions here? Thank.

0


source to share


1 answer


The problem you are facing is that 64 bit Windows does not work well with 32 bit ODBC. You can read about it here:

The 32-bit version of the ODBC Administrator tool and the 64-bit version of the ODBC Administrator tool display both 32-bit custom DSNs and 64-bit custom DSNs on a 64-bit Windows operating system .



The work around is to tune the target ODBC driver for the architecture you want to implement.

A side note trying to implement ODBC for oracle on a mixed architecture platform has become a headache for us. So, we have implemented access to oracle via CX_Oracle

+1


source







All Articles