Hi,
I am having trouble connecting to a SQL Server Instance via web2py. I tried connecting to three different SQL Server instances (all 2014) on three different servers on three different instances of web2py.
Here is the full traceback:
Traceback (most recent call last):
File "/home/mdipierro/make_web2py/web2py/gluon/restricted.py", line 220, in restricted
File "C:/Users/Administrator/Downloads/web2py_win/web2py/applications/stoptaneous/models/db.py", line 21, in <module>
db = DAL('mssql://api:hotshot22@WIN-K5BSFDVN3KM/GTFSChicago')
File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 7867, in __init__
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 7845, in __init__
File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 688, in __call__
File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 3454, in __init__
File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 648, in reconnect
File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 3452, in connector
Error: ('08001', '[08001] [Microsoft][ODBC SQL Server Driver][Shared Memory]SSL Security error (18) (SQLDriverConnect); [01000] [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (SECCreateCredentials()). (0); [01S00] [Microsoft][ODBC SQL Server Driver]Invalid connection string attribute (0)')
For what it is worth, I can connect via pyodbc and the following code runs just fine for me (aliased to protect the innocent) and displays the expected results.
import pyodbc
cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=localhost;DATABASE=testDB;UID=testUser;PWD=password')
cursor = cnxn.cursor()
cursor.execute("select * from sample_table")
rows = cursor.fetchall()
for row in rows:
print row
Here is my connection string in web2py:
db = DAL('mssql://testUser:password@localhost/testDB')
In addition, I worked on a project roughly a year ago and a colleague was able to connect to our SQL Server instance just fine (2008 r2 instance) using web2py. Examined his code and it looks identical to this with the references changed. Perplexed at this point. Any advice is greatly appreciated.
Best,
Ryan