that's indeed very strange. What driver is DAL using ? (you can see it even
when you start web2py as a "welcome" message in the cmdline)
On Thursday, August 21, 2014 3:50:17 AM UTC+2, Ryan Hood wrote:
>
> Thanks for the advice and for sharing your experiences. Also appreciate
> the mmsql4 tip. So this will probably surprise you, but I still get the
> same SSL error when I switch to this connection string: mssql://DRIVER={SQL
> Server};SERVER=localhost;DATABASE=testDB;UID=testUser;PWD=password.
>
> I again tested the code above with pure pyodbc and that still works fine.
>
> On Wednesday, August 20, 2014 3:10:52 PM UTC-5, Niphlod wrote:
>>
>> uhm. connecting to "localhost" and from outside can require very
>> different handshakes. For what is worth, I work daily with 2014 and I can
>> connect fine (as long as the odbc driver is there). Your error seems to
>> pinpoint to SSL security needed to connect to that host.
>>
>> Before jumping in that ship, however, there's a thing you can try:
>>
>> mssql://DRIVER={SQL
>> Server};SERVER=localhost;DATABASE=testDB;UID=testUser;PWD=password
>>
>> if you can connect from "pure" pyodbc, than this will use EXACTLY the
>> same method to connect with the DAL.
>>
>>
>> PS: if you're using 2014, you can benefit from the mssql4:// that
>> improves performances with pagination.
>>
>> On Wednesday, August 20, 2014 4:56:52 AM UTC+2, Ryan Hood wrote:
>>>
>>> Hi,
>>>
>>> I am having trouble connecting to a SQL Server Instance via web2py. I
>>> tried connecting to three different SQL Server instances (all 2014) on
>>> three different servers on three different instances of web2py.
>>>
>>> Here is the full traceback:
>>>
>>> Traceback (most recent call last):
>>>> File "/home/mdipierro/make_web2py/web2py/gluon/restricted.py", line 220,
>>>> in restricted
>>>> File
>>>> "C:/Users/Administrator/Downloads/web2py_win/web2py/applications/stoptaneous/models/db.py"
>>>> <http://127.0.0.1:8000/admin/default/edit/stoptaneous/models/db.py>, line
>>>> 21, in <module>
>>>> db = DAL('mssql://api:hotshot22@WIN-K5BSFDVN3KM/GTFSChicago')
>>>> File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 7867, in
>>>> __init__
>>>> RuntimeError: Failure to connect, tried 5 times:
>>>> Traceback (most recent call last):
>>>> File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 7845, in
>>>> __init__
>>>> File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 688, in
>>>> __call__
>>>> File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 3454, in
>>>> __init__
>>>> File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 648, in
>>>> reconnect
>>>> File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 3452, in
>>>> connector
>>>> Error: ('08001', '[08001] [Microsoft][ODBC SQL Server Driver][Shared
>>>> Memory]SSL Security error (18) (SQLDriverConnect); [01000]
>>>> [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen
>>>> (SECCreateCredentials()). (0); [01S00] [Microsoft][ODBC SQL Server
>>>> Driver]Invalid connection string attribute (0)')
>>>>
>>>>
>>> For what it is worth, I can connect via pyodbc and the following code
>>> runs just fine for me (aliased to protect the innocent) and displays the
>>> expected results.
>>>
>>> import pyodbc
>>> cnxn = pyodbc.connect('DRIVER={SQL
>>> Server};SERVER=localhost;DATABASE=testDB;UID=testUser;PWD=password')
>>> cursor = cnxn.cursor()
>>> cursor.execute("select * from sample_table")
>>> rows = cursor.fetchall()
>>> for row in rows:
>>> print row
>>>
>>>
>>> Here is my connection string in web2py:
>>> db = DAL('mssql://testUser:password@localhost/testDB')
>>>
>>> In addition, I worked on a project roughly a year ago and a colleague
>>> was able to connect to our SQL Server instance just fine (2008 r2 instance)
>>> using web2py. Examined his code and it looks identical to this with the
>>> references changed. Perplexed at this point. Any advice is greatly
>>> appreciated.
>>>
>>> Best,
>>> Ryan
>>>
>>>
>>>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.