Slightly OT: odbc.odbc() - how to specify user, password?

Joseph A Knapka jknapka at earthlink.net
Tue Jan 15 18:28:38 EST 2002


Hi,

I am having a problem connecting to an Oracle ODBC source
using ActiveState Python 2.1.1.  I prefer to use the MicroSoft
Oracle ODBC driver, because basically my employer requires it
(they've apparently had "stability problems" with the driver
supplied by Oracle). However, I cannot get the M$ driver to
connect successfully.

According to <http://www.python.org/windows/OdbcHints.html>,
the correct way to do it is to use

conn = odbc.odbc("%s/%s/%s"%(datasource,user,password))

I have two identically-configured ODBC sources, one
using the Oracle driver and one using the M$ driver.
Using the Oracle-supplied driver, the connection call
above works fine, but with the M$ driver the result is
invariably a brief traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?:
dbi.internal-error: [Microsoft][ODBC driver for Oracle]
     [Oracle] in LOGIN

Naturally, this stunningly informative message has not
helped me to solve my problem :-(

FWIW, the client is an NT4 box with Oracle 8i installed;
the server is another NT4 box with Oracle 8.0.4. I have
a lot of C and C++ code that uses the M$ driver
successfully, so I am reasonably certain that all is
well at the DB and ODBC-driver level. Has anyone got an
idea what's going on here?

Thanks,

-- Joe
"I should like to close this book by sticking out any part of my neck
 which is not yet exposed, and making a few predictions about how the
 problem of quantum gravity will in the end be solved."
 --- Physicist Lee Smolin, "Three Roads to Quantum Gravity"



More information about the Python-list mailing list