2

I've tried the following:

>>> import pyodbc

>>> cnxn = pyodbc.connect(Driver="MDB", database="SohabeD51.mdb")
pyodbc.Error: ('08001', '[08001] [unixODBC]Could not find DSN in
                connect string (1) (SQLDriverConnectW)')

Connecting to a database using a DSN entry works fine, but I'd like to supply a database in the code.

Georg Schölly
  • 124,188
  • 49
  • 220
  • 267

3 Answers3

2

No. Mdbtools 0.5 don't support this.

Georg Schölly
  • 124,188
  • 49
  • 220
  • 267
2

I know this is an old question, but actually (0.7.1) MDBTools DOES support DSN-less connections. The syntax for the connection string is something like

DRIVER=Microsoft Access Driver (*.mdb);DBQ=/path/to/your/file.mdb;UID=;PWD=;

You can download it from Github and compile it to ensure you are up to date:

https://github.com/brianb/mdbtools

Pere
  • 1,068
  • 12
  • 20
0

Here's what you need: http://code.google.com/p/pyodbc/wiki/ConnectionStrings