我無法獲得web2py連接到mssql。Web2Py將無法連接到MSSQL
<type 'exceptions.RuntimeError'>(Failure to connect, tried 5 times:
'NoneType' object has no attribute 'connect')
我的連接字符串是:
db = DAL('mssql://testUser:[email protected]/testDB')
環境
的Windows Server 2008 R2,64位操作系統
SQL Server 2008 R2的,局部的。
Web2py:源代碼安裝版本1.99.2(2011-09-26 06:55:33)穩定。
pyodbc
的Python 2.7.2
我測試過,我可以用pyodbc連接。以下代碼有效:
import pyodbc
cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=localhost;DATABASE=testDB;UID=testUser;PWD=password1')
cursor = cnxn.cursor()
cursor.execute("select * from tbUsers")
rows = cursor.fetchall()
for row in rows:
print row
感謝您的時間。
科裏。
如果你沒有在這裏得到一個答案(馬西莫不能無處不在),試着問在GoogleGroup:http://groups.google.com/group/web2py – JMax
會做。謝謝你的提示。 – cjmarques