ODBC/MS Access Doesn't Find Tables

Jose Correia joseKILL at THECAPSshangosoft.com
Thu Nov 9 16:28:24 CET 2000

This probably won't be much help, but I'm using the mxODBC module with no
problems.  I also used the Win32 extensions previously - no problem.  I'm on
Win 98se with Access 2000 and Python 1.5.2.  It might be a software version
issue that won't allow you to connect.  Here's the code I'm using.

dbc = odbc.Windows.Connect('db', user='', password='', clear_auto_commit=0)
# using Connect with capital C, although it is backwards compatible with
litlle c.  Tested it and confirmed it works.
# also works without the user, password and clear_auto fields.
crsr = dbc.cursor()
crsr.setcursorname("report")        # Don't need this to work.
crsr.execute("SELECT fld1, fld2  FROM table1")

Which doesn't look substantially different from yours.  Failing the software
version issue I can only suggest a reinstall of your drivers and modules
and, worst case, software... sorry.

Good luck...


"Karsten Schneider" <k at felinity.com> wrote in message
news:3A04DE33.8E2E83 at felinity.com...
> I'm trying to access a Microsoft Access database using either the mxODBC
> or Win32 ODBC module--without much luck. I can connect to the database,
> but the execute method fails. Here's what happens:
> >>> import ODBC.Windows
> >>> db=ODBC.Windows.connect('TestDB')
> >>> csr=db.cursor()
> >>> csr.execute('select * from codes')
> Traceback (innermost last):
>   File "<interactive input>", line 1, in ?
> ProgrammingError: ('S0002', -1305, "[Microsoft][ODBC Microsoft Access
> Driver] The Microsoft Jet database engine cannot find the input table or
> query 'codes'.  Make sure it exists and that its name is spelled
> correctly.", 3205)
> >>>
> The table exists, and the name is spelled correctly. Also, the same
> thing happens using the ODBC module from the Win32 Extension module.
> To test the Python installation I tried a different database
> (Interbase), which works. Also, I tried accessing the Access database
> using another application (Borland's DB Explorer), which works too.
> Which seems to indicate that the Python ODBC module and Access don't get
> along.
> Has anybody seen this problem before? Any ideas on what I'm doing wrong.
> --K

More information about the Python-list mailing list