18th_bronzeman has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks. I am attempting to connect to MSSQLS 2005 using ODBC with integrated NT authentication. I must do a DSN-less connection(Admin tools locked). My platform is Windows XP and I am using Active State Perl. I am able to get the connection however the database boots me off with:

MicrosoftODBC SQL Server DriverSQL ServerLogin failed for user 'Me'. (SQL-28000)(DBD: db_login/SQLConnect err=-1)

This is not because the credentials are incorrect. I do not know how to pass the proper authentication via a DSN-less connection. I have searched for DSN-less connections using "Integrated Windows NT Authentication" with no luck. Does anyone know how to use this type of authentication with a DSN-less ODBC connection?

In OLE the 'Integrated Security=SSPI' option is set. How do I set this in a DSN-less connection?

Thanks Monks

Dallas
  • Comment on Connection to MSSQL Database Using Windows NT Authentication

Replies are listed 'Best First'.
Re: Connection to MSSQL Database Using Windows NT Authentication
by planetscape (Chancellor) on Sep 15, 2007 at 20:13 UTC

    I am sorry that I do not know the answer to your question. However, usually I have pretty good luck when Googling for the actual text of the error message. For example, ODBC SQL Server Driver "Login failed for user" returns some hits that look pretty promising, especially the first one.

    HTH,

    planetscape
      Thank you Planetscape. After reading that I was able to get it going. I googled the entire error code before. With that truncation of the error code that you did the results came back quite different. I will use that trick googling in the future. Thank you again for all of your help.

      And for all of the DBI users using MSSQL ODBC with hopes of a DSN-Less connection with Trusted Connections/Windows Authentication:

      In the DBI string include 'Trusted Connection=yes', i.e.

      my $mssql_dbh = DBI -> connect(dbi:ODBC:driver={SQL Server};server={your_server};Trusted Connection=yes, user, password{
      PrintError => 0,
      RaiseError => 0,
      }) or die "\n\nthe mssql connection died with the following error: \n\n$DBI::errstr\n\n";