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)'}
But when I try to connect to a particular DNS an error is generated that I could not solve:
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)')
Could someone give me some idea of what I'm doing wrong?
- I already tried to enter the UID and PWD
- I already changed the version from 64 to 32 bits
HELP !!!