Re: [web2py] Re: Server SQL non existent or access denied

2020-08-18 Thread AGRogers
Hi Andrea

According to
https://docs.microsoft.com/en-us/sql/connect/python/pyodbc/step-3-proof-of-concept-connecting-to-sql-using-pyodbc?view=sql-server-ver15

*pyODBC uses* the *Microsoft ODBC* driver for SQL Server. If your version
of the *ODBC* driver *is* 17.1 or later, you *can use* the Azure Active
Directory interactive mode of the *ODBC* driver through *pyODBC*.

The numbers might not match yours but the concept should be the same -
pyodbc goes through Microsoft odbc.

It's been a while since I have done something with any odbc driver. But my
first step would be ensuring Microsoft ODBC is working fine. Maybe you have
done that already. I used to just create a connection from, say, MS Office
or Access and verify that I could read the data I needed. Then I would move
onto whatever app it was that I was trying to set up with odbc.




On Sun, 16 Aug 2020, 7:46 pm Andrea Fae',  wrote:

> Hello Villas, first thanks so much. You are gently.
> I will have possibility tomorrow to test. I just installed ODBC driver 17
> in my client, so tomorrow I will test first of all if with a windows DSN
> connection it's possible to connect to SQL server 2016. After it I will try
> using web2py...But I don't know the implication about windows ODBC driver,
> pyodbc (it's another odbc driver...so independent from windows ODBC driver
> I think), and I don't know exactly if my DAL syntax is correct or not,
> because I found different syntax in the web.
> If there will be anyone who could help me I will be very grateful.
> Thank you so much Villas!!
>
> Il giorno sabato 15 agosto 2020 17:27:41 UTC+2, villas ha scritto:
>>
>> >> Do I have to install any ODBC SQL Server Driver on my client?
>>
>> Hi Andrea
>> I feel your frustration and, although I do not use mssql,  I believe you
>> will certainly require a suitable ODBC driver installed so you can then
>> connect to that datasource using pyobc.
>> Maybe this will help  https://github.com/mkleehammer/pyodbc/wiki
>> Note that you should be able to use the pyodbc library independently from
>> web2py.
>> I hope that other mssql users can give better advice.
>> All the best
>>
>> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/a3fd7654-838e-416b-b7f6-8c531388979ao%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CACWMBMPttU-_pmRy3Upsi7ZaZNEeueg41g0ORD_PfEyX%2BZtxbA%40mail.gmail.com.


[web2py] Re: Server SQL non existent or access denied

2020-08-16 Thread Andrea Fae'
Hello Villas, first thanks so much. You are gently.
I will have possibility tomorrow to test. I just installed ODBC driver 17 
in my client, so tomorrow I will test first of all if with a windows DSN 
connection it's possible to connect to SQL server 2016. After it I will try 
using web2py...But I don't know the implication about windows ODBC driver, 
pyodbc (it's another odbc driver...so independent from windows ODBC driver 
I think), and I don't know exactly if my DAL syntax is correct or not, 
because I found different syntax in the web.
If there will be anyone who could help me I will be very grateful.
Thank you so much Villas!!

Il giorno sabato 15 agosto 2020 17:27:41 UTC+2, villas ha scritto:
>
> >> Do I have to install any ODBC SQL Server Driver on my client?
>
> Hi Andrea
> I feel your frustration and, although I do not use mssql,  I believe you 
> will certainly require a suitable ODBC driver installed so you can then 
> connect to that datasource using pyobc.
> Maybe this will help  https://github.com/mkleehammer/pyodbc/wiki
> Note that you should be able to use the pyodbc library independently from 
> web2py.
> I hope that other mssql users can give better advice.
> All the best
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a3fd7654-838e-416b-b7f6-8c531388979ao%40googlegroups.com.


[web2py] Re: Server SQL non existent or access denied

2020-08-15 Thread villas
>> Do I have to install any ODBC SQL Server Driver on my client?

Hi Andrea
I feel your frustration and, although I do not use mssql,  I believe you 
will certainly require a suitable ODBC driver installed so you can then 
connect to that datasource using pyobc.
Maybe this will help  https://github.com/mkleehammer/pyodbc/wiki
Note that you should be able to use the pyodbc library independently from 
web2py.
I hope that other mssql users can give better advice.
All the best

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7cd08e24-8872-412c-b5a9-4814a83ce2bfo%40googlegroups.com.


[web2py] Re: Server SQL non existent or access denied

2020-08-15 Thread Andrea Fae'
Please can anyone help me? thank you

Il giorno venerdì 14 agosto 2020 alle 12:47:36 UTC+2 Andrea Fae' ha scritto:

> Hello I have this problem
>
> c:\web2py>python web2py.py -S ITAsset -M -P
> No handlers could be found for logger "web2py"
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2020
> Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
> Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000
> Traceback (most recent call last):
>   File "c:\web2py\gluon\restricted.py", line 227, in restricted
> exec ccode in environment
>   File "applications\ITAsset\models\db.py", line 35, in 
> check_reserved=['all'])
>   File "c:\web2py\gluon\packages\dal\pydal\base.py", line 174, in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File "c:\web2py\gluon\packages\dal\pydal\base.py", line 473, in __init__
> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "c:\web2py\gluon\packages\dal\pydal\base.py", line 446, in __init__
> self._adapter = ADAPTERS[self._dbname](**kwargs)
>   File "c:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 60, in 
> __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File "c:\web2py\gluon\packages\dal\pydal\adapters\mssql.py", line 159, 
> in __init__
> if do_connect: self.reconnect()
>   File "c:\web2py\gluon\packages\dal\pydal\connection.py", line 125, in 
> reconnect
> self.connection = f()
>   File "c:\web2py\gluon\packages\dal\pydal\adapters\mssql.py", line 157, 
> in connector
> return self.driver.connect(cnxn, **driver_args)
>   File "C:\Python27\lib\site-packages\pypyodbc.py", line 2454, in __init__
> self.connect(connectString, autocommit, ansi, timeout, 
> unicode_results, readonly)
>   File "C:\Python27\lib\site-packages\pypyodbc.py", line 2507, in connect
> check_success(self, ret)
>   File "C:\Python27\lib\site-packages\pypyodbc.py", line 1009, in 
> check_success
> ctrl_err(SQL_HANDLE_DBC, ODBC_obj.dbc_h, ret, ODBC_obj.ansi)
>   File "C:\Python27\lib\site-packages\pypyodbc.py", line 987, in ctrl_err
> raise DatabaseError(state,err_text)
> DatabaseError: (u'08001', u'[08001] [Microsoft][ODBC SQL Server 
> Driver][DBNETLIB]Server SQL inesistente o accesso negato.')
>
>
> My uri is 
>
> uri   = mssql4://sa:password@TS-SQL2016R2\SQLEXPRESS/itassetdb
>
> Do I have to install any ODBC SQL Server Driver on my client? In which 
> way? I think I'm using pyodbc driver with python...
> Can you suggest me anything?
> Thanks so much
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c277bca4-f4dd-43a7-9155-9c271629ad0bn%40googlegroups.com.