Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 'Login failed for user'
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 01/02/2013 :  14:26:51  Show Profile  Reply with Quote
I have problem setting up a new user on my local ms sql express.

- I have my sql server instance configured to SQL Server and Windows authentication mode
- I create a new login, with SQL Server authentication, choose a password and unmark 'enforce password policy'. And also specify a default database.
- I then go to my database (in management studio) and create a new user with the same name as my just created login, select also the later, and choose db_owner for database role.
- And specify my connectionstring like:
<add name="TestConnection" connectionString="Data Source=(Local)\SQLEXPRESS;Initial Catalog=MyDatabase;User ID=username;Password=pwd;" providerName="System.Data.SqlClient"/>

Starting Member

35 Posts

Posted - 01/02/2013 :  16:48:22  Show Profile  Reply with Quote
1. did you try to connect with SSMS with that account and does the authentication work?
2. did you try the connection using a udl file?
3. does it work locally?

you could try to get more info using the profiler trace, but it is hard from your description to figure out what exactly the issue might be.

Could you paste the exact error message?
Go to Top of Page

Starting Member

2 Posts

Posted - 01/06/2013 :  07:38:11  Show Profile  Reply with Quote
Thanks, I missed to restart my server for configuration changes to take place.

So now I am able to set up a login-user on my local sql instance.

But when I try to connect to my remote server I got this error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I am able to login with my user to SSMS, have enabled named pipes and TCP/IP and allowed remote connections.
In Configuration Manager I see that SQL Server Agent and SQL Server Browser are stopped, with start mode: Other(...
don't know if that could be the causes.
Go to Top of Page

Flowing Fount of Yak Knowledge

United Kingdom
2179 Posts

Posted - 01/06/2013 :  11:31:19  Show Profile  Visit jackv's Homepage  Reply with Quote
Check this throubleshooting guide on this error :

Jack Vamvas
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000