Jan-31-2018, 07:43 PM
Hi,
I am a new Python programmer and I have question regarding database. I couldn’t find the “database” category, so I am posting here. I have 64-bit MS Windows 8.1 pro, 2013 MS Office, 32-bit Python 3.6.4, and pypyodbc. I installed 32-bit MS Access driver engine 2010. I was trying to connect to MS Access database, either .mdb or .accdb, with the following code:
File "C:\Python\Pyhton36-32\lib\site-packages\pypyodbc.py", line 985, in ctrl_err
raise Error(state,err_text)
pypyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified')
* End of error message *
“database1” in the clause 'DATABASE=database1;’ is a DSN entry. I also ran the code without it, but getting the same error message.
I replaced ODBC with the OLEDB statement, but again I had the same error message.
I would appreciate if somebody can find out the solution.
Thank you.
I am a new Python programmer and I have question regarding database. I couldn’t find the “database” category, so I am posting here. I have 64-bit MS Windows 8.1 pro, 2013 MS Office, 32-bit Python 3.6.4, and pypyodbc. I installed 32-bit MS Access driver engine 2010. I was trying to connect to MS Access database, either .mdb or .accdb, with the following code:
import pypyodbc conn_str = (Driver={Microsofr Access Drive (*.mdb, *.accdb)};' DBQ=c:\myPythonProgs\database1.mdb;' 'DATABASE=database1;') cnxn = pypyodbc.connect(conn_str)I got an error message, and its last 2 statements are:
File "C:\Python\Pyhton36-32\lib\site-packages\pypyodbc.py", line 985, in ctrl_err
raise Error(state,err_text)
pypyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified')
* End of error message *
“database1” in the clause 'DATABASE=database1;’ is a DSN entry. I also ran the code without it, but getting the same error message.
I replaced ODBC with the OLEDB statement, but again I had the same error message.
I would appreciate if somebody can find out the solution.
Thank you.