Florent Guerrier
2015-05-08 17:52:38 UTC
Hi,
I am trying to use the odbc driver
(mdbtools-devel,x86_64,0.6-0.7.cvs20051109.el6.1) with pyodbc:
*conn = pyodbc.connect('DSN=MDBDSN; Database=/myfolder/A.mbd')*
*cursor = conn.cursor()*
*Description = MDBDSN*
*Driver = MDBTools*
*Servername = localhost*
*Database=/myfolder/B.mdb*
*Description = MDBTools*
*Driver = path/libmdbodbc.so*
*Setup = path/libmdbodbc.so*
*Driver64 = path/libmdbodbc.so*
*Setup64 = path/libmdbodbc.so*
*FileUsage = 1*
But no matter what I do (change the order, lowercase/uppercase database,
"Database", etc) I never get the cursor to query against "A.mdb" (from the
connection string). So it seems "Database" is not getting overridden... And
I would love to avoid having to rely on DSN for what I need to do!
To summarize: Is there anyway to get a DSN-less connection setup with the
ODBC Driver using pyodbc?
Thanks,
Flo
I am trying to use the odbc driver
(mdbtools-devel,x86_64,0.6-0.7.cvs20051109.el6.1) with pyodbc:
*conn = pyodbc.connect('DSN=MDBDSN; Database=/myfolder/A.mbd')*
*cursor = conn.cursor()*
more odbc.ini
*[MDBDSN]**Description = MDBDSN*
*Driver = MDBTools*
*Servername = localhost*
*Database=/myfolder/B.mdb*
more odbcinst.ini
*[MDBTools]**Description = MDBTools*
*Driver = path/libmdbodbc.so*
*Setup = path/libmdbodbc.so*
*Driver64 = path/libmdbodbc.so*
*Setup64 = path/libmdbodbc.so*
*FileUsage = 1*
But no matter what I do (change the order, lowercase/uppercase database,
"Database", etc) I never get the cursor to query against "A.mdb" (from the
connection string). So it seems "Database" is not getting overridden... And
I would love to avoid having to rely on DSN for what I need to do!
To summarize: Is there anyway to get a DSN-less connection setup with the
ODBC Driver using pyodbc?
Thanks,
Flo