This question may be repetitive as I checked this forum for the same issue and did as suggested in the forum for my issue. But my issue seems to be not going.
All, I am trying to connect to MS SQL Server installed on an ETL Server from my PC using python pyodbc module.
import pyodbc
print(pyodbc.drivers())
connStr = pyodbc.connect("Driver = {SQL Server Native Client 11.0};"
"SERVER = S871DBSERV;"
"DATABASE = myclientdb;"
"Trusted_Connection=yes;")
and I also tried below as well
print(pyodbc.drivers())
connStr = pyodbc.connect("Driver = {ODBC Driver 13 for SQL Server};"
"SERVER = S871DBSERV;"
"DATABASE = myclientdb;"
"Trusted_Connection=yes;")
am still not able to make a connection and below is the output with error I am seeing. As you can see the drivers that I specified in the above connect statement is listed as result of
print(pyodbc.drivers())
['Driver da Microsoft para arquivos texto (*.txt; .csv)', 'Driver do Microsoft Access (.mdb)', 'Driver do Microsoft dBase (.dbf)', 'Driver do Microsoft Excel(.xls)', 'Driver do Microsoft Paradox (.db )', 'Microsoft Access Driver (.mdb)', 'Microsoft Access-Treiber (.mdb)', 'Microsoft dBase Driver (.dbf)', 'Microsoft dBase-Treiber (.dbf)', 'Microsoft Excel Driver (.xls)', 'Microsoft Excel-Treiber (.xls)', 'Microsoft ODBC for Oracle', 'Microsoft Paradox Driver (.db )', 'Microsoft Paradox-Treiber (.db )', 'Microsoft Text Driver (.txt; .csv)', 'Microsoft Text-Treiber (.txt; *.csv)', 'SQL Server', 'DataDirect 7.1 DB2 Wire Protocol', 'DataDirect 7.1 Informix Wire Protocol', 'DataDirect 7.1 Sybase Wire Protocol', 'DataDirect 7.1 SQL Server Wire Protocol', 'DataDirect 7.1 dBaseFile', 'DataDirect 7.1 FoxPro 3.0', 'DataDirect 7.1 MySQL Wire Protocol', 'DataDirect 7.1 New SQL Server Wire Protocol', 'DataDirect 7.1 Greenplum Wire Protocol', 'Informatica MongoDB ODBC Driver', 'DataDirect 7.1 Oracle Wire Protocol', 'Informatica Cassandra ODBC Driver', 'SQL Server Native Client 11.0', 'ODBC Driver 13 for SQL Server']
Traceback (most recent call last): File "c:/Users/marunachalam/Downloads/FTPGetFiles.py", line 92, in connStr = pyodbc.connect("Driver = {'SQL Server Native Client 11.0'};" pyodbc.InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
I am not sure what I am missing here. Please help.
Thanks, Mani A