Pyodbc error Data source name not found, and default driver paradox not specified

I am trying to use pyobdcto read data from a Paradox database, and I keep getting the following error when trying to connect to the database:

pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')

I tried to create new DNS links for the database, but this did not help.

My system links:

This is what the system DNS looks like

My code is:

import os
import sys
import time
import pyodbc

LOCATION = "c:\Users\Marcello\Desktop\DATA\ScorMonitor.db"

cnxn = pyodbc.connect(r"Driver={{Microsoft Paradox Driver (*.db )}};Fil=Paradox 5.X;DefaultDir={0};Dbq={0}; CollatingSequence=ASCII;")
cursor = cnxn.cursor()
cursor.execute("select last, first from test")
row = cursor.fetchone()
print row
+18
source share
4 answers

Two thoughts on what to check:

1) . ODBC ( http://www.visokio.com/kb/db/dsn-less-odbc). , MDB,

  • → → .
  • " DSN" "".
  • (, "Microsoft Access Driver (*.mdb)" ) ""
  • "" , .dsn( , ).
  • "", "".
  • ODBC . , Microsoft Access Select .mdb, OK.
  • .dsn "".

DSN :

[ODBC]
DRIVER=Microsoft Access Driver (*.mdb)
UID=admin
UserCommitSync=Yes
Threads=3
SafeTransactions=0
PageTimeout=5
MaxScanRows=8
MaxBufferSize=2048
FIL=MS Access
DriverId=25
DefaultDir=C:\
DBQ=C:\db1.mdb

:

  • [ODBC]
  • ,
  • name = value , .

. :

DRIVER={Microsoft Access Driver (*.mdb)};UID=admin;UserCommitSync=Yes;Threads=3;SafeTransactions=0;PageTimeout=5;axScanRows=8;MaxBufferSize=2048;FIL={MS Access};DriverId=25;DefaultDir=C:\;DBQ=C:\db1.mdb

2) 32/64 . 32- 64- . Python .

+26

, , , . 64- Python 32- ODBC Windows 10 ( ). Fall Creator Edition Microsoft Office Pro 2016. MS Office - 32- ( ...) - ​​ , , , 32- Office, - 32- ODBC MS Access. , MS Office, 64- .

64- Python 32- ODBC Microsoft Access, Microsoft 64- ODBC, 32- MS Office.

UNINSTALL MS Office , , , 64-. , , Outlook. , 64- ODBC, Python - .

+2

ODBC 32- 64-.

→ → (ODBC) → → → → %windir%\System32\odbcad32.exe

%windir%\SysWOW64\odbcad32.exe

0

Office Python . , , 64- Office Python, ...

.

(2) ODBC Microsoft:

  1. Microsoft Access (*.mdb)

    Microsoft Access (*.mdb) - 32- Jet Jet ODBC. Windows. .mdb ( .accdb). .

  2. Microsoft Access (*.mdb, *.accdb)

    Microsoft Access (*.mdb, *.accdb) - ODBC "ACE". Windows, Microsoft Office. "" Microsoft Office. 64- 32- "ACE" ( ), 64-, 32- . ( , , "" Office. , Microsoft Office, Python, "" "" .)

, ODBC Microsoft Access Python ( Windows), -

        pyodbc

         [x x pyodbc.drivers(), x.startswith(" Microsoft Access")]

   , , 64- Python 64- "ACE". " Microsoft Access (*.mdb)" .accdb, 32- "ACE".

!

0

Source: https://habr.com/ru/post/1608088/


All Articles