I have some databases to which I want to connect via pyodbc, if I enter the code:
import pyodbc
pyodbc.dataSources()
I get the following:
Out[28]:
{'dBASE Files': 'Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)',
'Excel Files': 'Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)',
'MS Access Database': 'Microsoft Access Driver (*.mdb, *.accdb)',
'bdicent': 'IBM INFORMIX ODBC DRIVER (64-bit)',
'troya': 'IBM INFORMIX ODBC DRIVER (64-bit)',
'bdicred': 'IBM INFORMIX ODBC DRIVER (64-bit)',
'bdisolicitud': 'IBM INFORMIX ODBC DRIVER (64-bit)',
'bd_reportos': 'IBM INFORMIX ODBC DRIVER (64-bit)',
'bd_prendarios': 'IBM INFORMIX ODBC DRIVER (64-bit)',
'bd_credito2': 'IBM INFORMIX ODBC DRIVER (64-bit)',
'bdigaran': 'IBM INFORMIX ODBC DRIVER (64-bit)',
'dbterfin': 'IBM INFORMIX ODBC DRIVER (64-bit)',
'bd_garantias_liq': 'IBM INFORMIX ODBC DRIVER (64-bit)',
'Visio Database Samples': 'Microsoft Access Driver (*.mdb, *.accdb)',
'bdsolicitud': 'IBM INFORMIX ODBC DRIVER (64-bit)'}
What gives me to understand that if I have access to the bases, since the function is detecting them, however, when I try to connect I get an error:
con=pyodbc.connect('DNS=bd_reportos')
Traceback (most recent call last):
File "<ipython-input-29-27f04177a1ab>", line 1, in <module>
con=pyodbc.connect('DNS=bd_reportos')
InterfaceError: ('IM002', '[IM002] [Microsoft][Administrador de controladores ODBC] No se encuentra el nombre del origen de datos y no se especificó ningún controlador predeterminado (0) (SQLDriverConnect)')
I have not been able to solve the problem, I have not been able to connect to my bases. Does anyone know what I am doing wrong?
P.D.
I already tried to introduce the UID and PWD and it gives me the same result (in theory I do not need to enter it).
I already changed the python version from 64 to 32 bits and with both I get the same error.