CJM, Can I ask how you set the driver manually ? I want to try on my machine too.
On Oct 26, 8:18 am, CJM <coreymarq...@gmail.com> wrote: > Thank you Massimo! > > The driver did return None and setting the driver manually did the > trick. > > Is this an issue with web2py or did I somehow setup my machine > incorrectly? > > On Oct 25, 6:15 pm, Massimo Di Pierro <massimo.dipie...@gmail.com> > wrote: > > > > > > > > > try: > > > from gluon.dal import MSSQLAdapter > > print MSSQLAdapter.driver > > > My guess isthat it is failing to import pyodbc from dal.py somehow and > > the driver should should be set to > > > driver = globals().get('pyodbc',None) > > > is set to None instead. > > > On Oct 25, 10:20 am, CJM <coreymarq...@gmail.com> wrote: > > > > I'm unable to get web2py to connect to mssql. > > > > <type 'exceptions.RuntimeError'>(Failure to connect, tried 5 times: > > > 'NoneType' object has no attribute 'connect') > > > > My connection string is: db = DAL('mssql:// > > > testUser:password1@localhost/testDB') > > > > Environment > > > Windows Server 2008 R2, 64-bit operating system > > > SQL Server 2008 R2, local. > > > Web2py: source code install version 1.99.2 (2011-09-26 06:55:33) > > > stable. > > > pyodbc > > > Python 2.7.2 > > > > I've tested that I can connect using the pyodbc. The following code > > > works: > > > > 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 > > > > Thanks for your time. > > > > Corey.