InterfaceError [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified
See original GitHub issue- Python: 3.9.7 (32-bit)
- pyodbc: 4.0.28
- OS: Window 10 Enterprise 64-bit
- DB: MsAccess 365 16.0
- driver: Microsoft Access Driver (*.mdb, *.accdb)
Observed behavior: When I connect the database in VS Code, the connection is made & there are no errors, but when I compile the code into an .exe file w/ pyinstaller, I get the following error.
<class ‘pyodbc.InterfaceError’> (‘IM002’, ‘[IM002] [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified (0) (SqlDriverConnect)’)
Here is the connection string:
conn_str = (r"DRIVER=Microsoft Access Driver (*.mdb, *.accdb); DBQ="networkdrive\myDb.accdb;") conn = pyodbc.connect(conn_str) crsr = conn.cursor()
Expected Behavior: Connection to the database is made successfully
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
[Microsoft][ODBC Driver Manager] Data source name not ...
Got this error because I had the Data Source Name in User DSN instead of System DSN ... Manager] Data source name not...
Read more >How to Resolve: [IM002] [Microsoft][ODBC Driver Manager ...
How to Resolve: [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)
Read more >[ODBC Driver Manager] Data source name not found and no ...
Error : [ODBC Driver Manager] Data source name not found and no default driver specified. Hi. I am trying to connect to AS...
Read more >DataDirect "Data source name not found and no default driver ...
Information · Verify that the ODBCINI (or ODBC_INI or SHADOW_INI) environment variable points to the correct odbc.ini (or shadow. · Verify that ...
Read more >Resolving "Data source name not found and no default driver ...
... Connect (driver): SQL state IM002, message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Try creating an executable using the same procedure as your example above except that the python code to run is
to see what drivers are available in that context.
This saved my 4 days thank you very much