Hi Guys,

i am able to connect to our MSSQL Database with the following command:

*cnxn = 
pyodbc.connect('SERVER=dbhost\dbinstance;DATABASE=dbname;UID=dbuser;PWD=dbpassword')*

*(By the way: We use FreeTDS as Driver but i removed it from this example)*

If i use the PyDAL with this String:

*DAL('mssql://dbuser:dbpassword@dbhost/dbinstance/dbname')*

The Regex in the ...*pydal/adapters/mssql.py *parses the values to this 
form. Which is then handled by the *connect()* function:

*'SERVER=dbhost;PORT=1433;DATABASE=dbinstance/dbname;UID=dbuser;PWD=dbpassword'*


This is not working with our database. And i get the following error 
message:



*OperationalError: ('08S01', u'[08S01] [unixODBC][FreeTDS][SQL 
Server]Unable to connect: Adaptive Server is unavailable or does not exist 
(20009) (SQLDriverConnect)')*

1) After several attempts, we figured out, that the Regex should put the 
*dbinstance*  after the dbhost in the *"SERVER=" *Key instead of 
*DATABASE=dbinstance/dbname*
2) If no Port ist provided like here : 
*'mssql://dbuser:dbpassword@dbhost/dbinstance/dbname', 
* the Port 1433 is set as Default: *PORT=1433. *This is not working in our 
case. There must be no* "PORT="* Key provided. 

Could you fix this in the *mssql.*py?


Best Regards
Artem

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to