Skip to content

Commit a346e8f

Browse files
committed
Merge branch 'master' of https://github.com/ODM2/ODM2PythonAPI
2 parents 3bd605d + f798e13 commit a346e8f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

odm2api/ODMconnection.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,12 @@ def __buildConnectionString(self, conn_dict):
196196
else:
197197
if conn_dict['engine'] == 'mssql':
198198
driver = "pyodbc"
199-
sources = pyodbc.dataSources()
200-
driverName = sources['SQL Server']
201-
driverName = driverName.strip().replace(' ', '+')
202199
#self._connection_format = "%s+%s://%s:%s@%s/%s?driver=SQL+Server+Native+Client+10.0"
203-
self._connection_format = "%s+%s://%s:%s@%s/%s?driver=" + driverName
200+
conn = "%s+%s://%s:%s@%s/%s?driver=SQL+Server"
201+
if "sqlncli11.dll" in os.listdir("C:\\Windows\\System32"):
202+
conn = "%s+%s://%s:%s@%s/%s?driver=SQL+Server+Native+Client+11.0"
203+
self._connection_format = conn
204+
204205

205206
elif conn_dict['engine'] == 'mysql':
206207
driver = "pymysql"

0 commit comments

Comments
 (0)