locked
login failed for user ID 'sa', but not using user 'sa' RRS feed

  • Question

  • I know the SQL Server error log is correct:  Login failed for user 'sa'. Reason. Password did not match.....

    SQL Server 2012 Express on a Server2012

    I create an connection string for my C# desktop application using a text file connect.udl.  Open it up with OLE DB Core Services, enter the user ID 'myapplication' and the associated password.  Test connection and Test connection succeeded.  Copy the resulting connection string into my application (I am changing the app to point at a new SQL Server, this database server and connection method has been working for years pointing to the previous SQL server 2000).  SSMS logins in using SQL Authentication and 'sa' and password and myapplication/password.

    With the connect string as Provider=SQLOLEDB.1;Password=#$%&;User ID=myapplication.... the error message says 'sa'.  So I'm not sure what else to look at - I'm not logging in as 'sa'.  

    SQL Configuration has Named Pipes and TCP/IP enabled.  SQL Browser is running.  Another database table is is working fine! Where else can I look?  Is there a permission setting for my desktop application?  Thanks

    Thursday, April 23, 2015 4:01 AM

Answers

  • I suggest you step through the code in a debugger. The sa account won't be used unless the application specifies it.  Check for something either hard-coded in the application or a different configuration than the one expected.

    Be aware that the SQLOLEDB provider has been deprecated for many years.  Consider using the SQL Server 2012 Native Client provider instead.


    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

    Sunday, April 26, 2015 5:35 PM

All replies

  • Have you checked the connection string in your web.config/app.config? Use process monitor to check the issue.
    Friday, April 24, 2015 6:22 AM
  • this link should give all the connection string to sql server

    http://www.connectionstrings.com/sql-server/

    but can you verify if your application is really using that connection file ? try running trace alongside and try to connect to the database.. so do you atleast see  a call from this config file with username - myapplication??


    Hope it Helps!!

    Sunday, April 26, 2015 2:01 PM
  • I suggest you step through the code in a debugger. The sa account won't be used unless the application specifies it.  Check for something either hard-coded in the application or a different configuration than the one expected.

    Be aware that the SQLOLEDB provider has been deprecated for many years.  Consider using the SQL Server 2012 Native Client provider instead.


    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

    Sunday, April 26, 2015 5:35 PM