osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pyodbc -> MS-SQL Server Named Instance ?


On Tue, 2019-07-02 at 11:00 -0400, Adam Tauno Williams wrote:
> On Tue, 2019-07-02 at 09:41 -0400, Adam Tauno Williams wrote:
> > On Tue, 2019-07-02 at 07:36 +0200, Frank Millman wrote:
> > > On 2019-07-01 10:13 PM, Adam Tauno Williams wrote:
> > > > I am trying to connect to a Named Instance on an MS-SQL server
> > > > using pyODBC.
> 
> It appears that the instance location service doesn't work.??Digging
> out the instance->power assignment I can change the error message and
> create an authentication failed even in the Event Log!
> 
> It is sorta progress. :(
> 
> > > > db = pyodbc.connect(
> 
> ...??????driver='ODBC Driver 13 for SQL Server',
> ...??????server=r'sql.example.com,51994',
> ...??????database='dbname',
> ...??????user='*******',
> ...??????password='*******', )
> Traceback (most recent call last):
> ? File "<stdin>", line 6, in <module>
> pyodbc.Error: ('28000', "[28000] [Microsoft][ODBC Driver 13 for SQL
> Server][SQL Server]Login failed for user '*******'. (18456)
> (SQLDriverConnect)")

Interesting, it does appear to be a driver problem.

The old FreeTDS connection ( pymsssql ) works right away.

WORKS: pymssql.connect(
  host='sql.example.com\instanceName',
  user='******',password='********',
  database='dbName')

-- 
Adam Tauno Williams <mailto:awilliam at whitemice.org> GPG D95ED383
OpenGroupware Developer <http://www.opengroupware.us/>