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

Steve Holden sholden at holdenweb.com
Wed Jan 16 08:08:26 EST 2002


Have you imported the dbi module before the odbc module? This is a
documented requirement, but it doesn't stick out, and can give problems. May
not help, but it might.

Otherwise, if you *have* to use ODBC then mxODBC would be a sound
investment. Else consider the non-ODBC solutions available, including
DCOracle2 (somewhere in www.zope.org) and cxOracle (on www.computronix.com),
both of which appear to be sound interfaces.

regards
 Steve
--
http://www.holdenweb.com/


"Joseph A Knapka" <jknapka at earthlink.net> wrote in message
news:3C446357.9C766AFC at earthlink.net...
> 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