TrustedConnection broken for MSSQL-2008 native driver

Issue #1561 resolved
Former user created an issue

In SQL Server 2008 when using native driver to connect to the server, {{{TrustedConnection=Yes}}} does not work anymore. Instead {{{Trusted_Connection=Yes}}} (note underscore) should be used, which works also with previous versions of SQL Server.

This is an issue only when using {{{SQL Server Native Client 10.0}}} driver, so the following does not work:

create_engine('mssql://my_server/my_db?driver=SQL Server Native Client 10.0')

resulting in an error:

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

While these work just fine:

create_engine('mssql://my_server/my_db')
create_engine('mssql://my_server/my_db?driver=SQL Server') #// same as above actually

The workaround is to add the parameter manually:

create_engine('mssql://my_server/my_db?driver=SQL Server Native Client 10.0&Trusted_Connection=Yes')

but ideally it should be fixed as per attached patch files.

Comments (7)

  1. Mike Bayer repo owner

    works with sqlserver 2005, 2000, etc. ? I'd hate to change it across the board and then have other folks report it as a bug on that end.

  2. Former user Account Deleted

    I have tested it on both 2005/2008 and confirm it works.

    And if it is any comforting, this is what pyodbc is using (ConnectionStrings), as well as this is how it is documented on connectionstrings.com: * http://connectionstrings.com/sql-server * http://connectionstrings.com/sql-server-2005 * http://connectionstrings.com/sql-server-2008 and most importantly on MSDN (official documentation has Trusted_Connection with an underscore): * SQL Server 2008 * SQL Server 2005

  3. Log in to comment