Unable to open MS Access 2007 accdb file

437 views
Skip to first unread message

AlexandreS

unread,
Nov 22, 2010, 1:03:13 PM11/22/10
to pyodbc
Sorry if this is a repeat, but I could not find a solution in the
archives of this list...

I installed pyodbc pyodbc-2.1.8.win32-py2.6 in a Windows 7 machine
(python 2.6).

If I create a test access file (2007 accdb format), I'm unable to open
it in python:

>>> import pyodbc
>>> DBfile = r'C:\temp\testdb1.accdb'
>>> conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb,*.accdb)};DBQ='+DBfile)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pyodbc.Error: ('IM002', '[IM002] [Microsoft] [Gestor de controladores
de ODBC] O nome da origem de dados n\xe3o foi encontrado e n\xe3o foi
especificado nenhum controlador predefinido (0) (SQLDriverConnectW)')

which means "the name of the data source was not found and no
predefined controller was defined"

If I save the file testdb1 as a Access 2000 .mdb format:

>>> DBfile = r'C:\temp\testdb1.mdb'
>>> conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb)};DBQ='+DBfile)
>>>

It works...

So it looks like I'm lacking some kind of driver. If so, what and how
should I install it? If not, what do you think is going on?

I can't convert my real Access database to an older format, since
because of the features used MS Access refuses to do the conversion.

mkleehammer

unread,
Nov 24, 2010, 10:12:55 AM11/24/10
to pyodbc
I would guess that the name of the driver should not be in English.

I know the 2007 version works because I even have a set of unittests
(see tests/accesstests.py) and an empty .mdb and .accdb files to test
it with checked in.

I've also seen that the driver names are not in English on some of the
non-English boxes I have at work.

AlexandreS

unread,
Nov 24, 2010, 11:57:38 AM11/24/10
to pyodbc
On Nov 24, 4:12 pm, mkleehammer <mkleeham...@gmail.com> wrote:

> I've also seen that the driver names are not in English on some of the
> non-English boxes I have at work.
That's crazy...

> I would guess that the name of the driver should not be in English.

I tried to modify the name of the server, and it's the same: using
"Driver do Microsoft Access" instead of "Microsoft Access Driver"
works for .mdb files, but not for .accdb...

>>> DBfile = r'C:\temp\testdb2.mdb'
>>> conn = pyodbc.connect('DRIVER={Driver do Microsoft Access (*.mdb)};DBQ='+DBfile)
>>>

but
>>> DBfile = r'C:\temp\testdb1.accdb'
>>> conn = pyodbc.connect('DRIVER={Driver do Microsoft Access (*.mdb,*.accdb)};DBQ='+DBfile)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pyodbc.Error: ('IM002', '[IM002] [Microsoft][Gestor de controladores
de ODBC] O nome da origem de dados n\xe3o foi encontrado e n\xe3o foi
especificado nenhum controlador predefinido (0) (SQLDriverConnectW)')
>>>

No luck... Perhaps it's not really a language issue?
Reply all
Reply to author
Forward
0 new messages