[egenix-users] mx.ODBCConnect vs mx.ODBC, why am I seeing differences

M.-A. Lemburg mal at egenix.com
Mon Mar 23 11:10:06 CET 2009


On 2009-03-21 23:16, Tentin Quarantino wrote:
> Hi,
> 
> Perhaps I need perspective from other users.
> 
> I am experiencing different behavior with the same "driverString" when
> running the two packages "mx.ODBCConnect" and "mx.ODBC"?
> 
> Here is a brief summary:
> 
> #
> # mx.ODBC test code
> #
> import mx.ODBC.Windows as odbc
> # initialize "driverString" with exact same value as test code below
> db = odbc.DriverConnect(driverString)
> # Open a cursor
> cursor = db.cursor()
> 
> # -------------------------------
> 
> #
> # mx.ODBCConnect test code
> #
> 
> from mx.ODBCConnect.Client import ServerSession
> session = ServerSession(config_file=myConfig)
> server = session.open()
> # assume successful connection to the mxODBC Connect Server
> # initialize "driverString" with exact same value as test code above
> db = server.DriverConnect(driverString)
> # Open a cursor
> cursor = db.cursor()
> 
> # -------------------------------
> 
> In both tests above, the "driverString" is same exact code.
> The "driverString" is a common form.
> DRIVER={Microsoft Access Driver (*.mdb)};DBQ=C:\MyAccessDB.mdb;UID=;PWD=secrt
> 
> It works with mx.ODBC.
> 
> The second one generates an authentication error:
> mx.ODBCConnect.Error.ProgrammingError: ('42000', -1905,
> '[Microsoft][ODBC Microsoft Access Driver] Not a valid password.',
> 10102)
> 
> 
> What should I investigate to solve this problem?
> 
> Could the null UID cause a problem for mx.ODBCConnect?

Yes.

It is possible that the Access driver defaults to the login name
of the user accessing the database on the server. Since the mxODBC
Connect Server runs as service, the user account name is different
than the one you use to log in to the machine.

To prevent such problems, always provide a full UID in the connection
string.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Mar 23 2009)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2009-03-19: Released mxODBC.Connect 1.0.1      http://python.egenix.com/

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/



More information about the egenix-users mailing list