Two thoughts on what to check:
1) Your connection string is wrong. There's a way to get a known good connection string directly from the ODBC Administrator program (taken from http://www.visokio.com/kb/db/dsn-less-odbc). These instructions assume you're using an MDB, but the same process will work for a paradox file
- On a typical client PC, open Control Panel -> Administrative Tools -> Data Sources.
- Select the File DSN tab and click Add.
- Select the appropriate driver (e.g. "Microsoft Access Driver (*.mdb)") and click Next
- Click Browse and choose where you want to save the .dsn file (this is a temporary file you are going to delete later).
- Click Next then Finish.
- You will be shown the vendor-specific ODBC setup dialog. For example, with Microsoft Access, you might only need to click Select and browse to an existing .mdb file before clicking OK.
- Browse to the location of the .dsn file and open using Notepad.
In the DSN file you might see something similar to:
[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
To convert the above to the full connection strring:
- Omit the first [ODBC] line
- Put curly braces around all values containing spaces
- Put all name=value pairs on one line, separated by semicolons.
This gives you the full connection string. In this example, the string becomes:
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 bit mismatch. I've had troubles when mixing 32-bit python with 64-bit drivers, or vice-versa. You may want to check your Python interpreter and database driver line up.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…