There were changes in MS SQLServer driver?

125 views
Skip to first unread message

Jose

unread,
Oct 19, 2012, 9:36:53 AM10/19/12
to web...@googlegroups.com
Hello,

I have a production application that uses MS SQL Server in a UNIX environment, running web2py version 1.99.4.

the connection is: dal > unixodbc > freetds > sqlserver.

I'm trying to migrate to web2py  version 2.1.1, but fails to connect to the database:

<type 'exceptions.RuntimeError'>(Failure to connect, tried 5 times: Traceback (most recent call last): File "/usr/home/jose/web2py/gluon/dal.py", line 6754, in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs) File "/usr/home/jose/web2py/gluon/dal.py", line 3034, in __init__ if do_connect: self.reconnect() File "/usr/home/jose/web2py/gluon/dal.py", line 582, in reconnect self.connection = f() File "/usr/home/jose/web2py/gluon/dal.py", line 3032, in connector return self.driver.connect(cnxn,**driver_args) Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnectW)') )


the connection is:
db = DAL("mssql://CAPC;UID=user;PWD=pwd")

Any idea?

Thanks
Jose

Jose

unread,
Oct 19, 2012, 9:40:51 AM10/19/12
to web...@googlegroups.com

I found this [1] that I had asked. I see that the same error occurred with version 1.99.7


Jose

Jose

unread,
Oct 19, 2012, 10:51:40 AM10/19/12
to web...@googlegroups.com
I answer myself


db = DAL("mssql://CAPC;UID=user;PWD=pwd")

must explain the dsn:
db = DAL("mssql://dsn=CAPC;UID=user;PWD=pwd")

Jose

Massimo Di Pierro

unread,
Oct 19, 2012, 2:48:26 PM10/19/12
to web...@googlegroups.com
So, is the issue closed?

Jose

unread,
Oct 19, 2012, 4:26:03 PM10/19/12
to web...@googlegroups.com


El viernes, 19 de octubre de 2012 15:48:26 UTC-3, Massimo Di Pierro escribió:
So, is the issue closed?

Yes.

Jose 

Nguyen Minh Tuan

unread,
May 21, 2014, 1:18:26 AM5/21/14
to
Hi Jose,

I'm now have the same error with you.
and cannot connect to MSSQL server, I've read your self answer but can not understand.
Can you help me?


environment :
- CentOS 6.4, Nginx, uWSGI
- Python 2.7.6
- Web2py 2.9.5

Thanks,
Tuan.

Derek

unread,
May 23, 2014, 1:55:06 PM5/23/14
to web...@googlegroups.com
if you read the whole thing, he changed the way it works.

db = DAL('mssql://dsn=192.168.0.52;user=usr1;password=pwd1;') 

hint: You have to use DBAPI 2.0 connection strings.

http://legacy.python.org/dev/peps/pep-0249/#footnotes

On Tuesday, May 20, 2014 10:17:09 PM UTC-7, Nguyen Minh Tuan wrote:
Hi Jose,

I'm now have the same error with you.
and cannot connect to MSSQL server, I've read your self answer but can not understand.
Can you help me?


environment :
- CentOS 6.4, Nginx, uWSGI
- Python 2.7.6
- Web2py 2.9.5

Thanks,
Tuan.

On Saturday, October 20, 2012 3:26:03 AM UTC+7, Jose wrote:

Nguyen Minh Tuan

unread,
May 27, 2014, 6:29:06 AM5/27/14
to web...@googlegroups.com
Thanks Derek!


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/ISrawjvuWf0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages