check web2py/gluon/dal.py there is a try: import pyodbc. remove the try and check whay it fails. Must be a patch issue.
On Oct 25, 9:39 pm, Omi Chiba <ochib...@gmail.com> wrote: > CJM, > > Are you using apache using wsgi? if so, you're with me. You cannot > import > pyodbc.http://ochiba77.blogspot.com/2011/10/how-to-setup-web2py-apache-wsgi.... > > If you're using rocket server, it should connect because I'm > connecting without any problem. Only difference with your environment > is that I'm using Windows 7. I use actual server(computer) name > instead of localhost. You can try that to see if it makes any > difference. > > db = DAL('mssql:// testUser:password1@ServerName/testDB') > > if it's mssql server express, > > db = DAL('mssql:// testUser:password1@ServerName\SQLEXPRESS/testDB') > > On 10月25日, 午後4:14, CJM <coreymarq...@gmail.com> wrote: > > > > > > > > > It's a source code install. Hench the line: > > > > > Web2py: source code install version 1.99.2 (2011-09-26 06:55:33) > > > :) > > > On Oct 25, 12:10 pm, Bruno Rocha <rochacbr...@gmail.com> wrote: > > > > are you using source code or .exe version of web2py? > > > >http://zerp.ly/rochacbruno > > > Em 25/10/2011 13:31, "CJM" <coreymarq...@gmail.com> escreveu: > > > > > 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.