connection to master fails, to northwind succeeds

connection to master fails, to northwind succeeds

Post by David Thie » Sun, 21 Sep 2008 08:20:27


For the code:
using (IDbConnection sc = new SqlConnection(connStr))
{
sc.Open();
...

using the connection string
connStr = "Data Source=test23;Initial
Catalog=Northwind;Integrated Security=SSPI;";

it works fine

but using the connection string:
connStr = "Data Source=test23;Initial Catalog=master;Integrated
Security=SSPI;";

We have the following situation: From some computers it works, from
others we get the exception:

An error has occured while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not
open a connection to SQL Server)

Note 1: We have tried this with both SSPI and passing a username &
password.

Note 2: Some systems connect fine, others fail - but they are all
connecting to the same server so the server must be ok.

Note 3: All machines can connect to Northwind, it's master that's the
problem.

Note 4: The machines that fail do not have SqlClient listed as a
datasource in Windows.

Any ideas?

thanks - dave

david@ XXXX@XXXXX.COM
Windward Reports -- http://www.yqcomputer.com/
me -- http://www.yqcomputer.com/

Cubicle Wars - http://www.yqcomputer.com/
 
 
 

connection to master fails, to northwind succeeds

Post by Gregory A. » Sun, 21 Sep 2008 08:51:02

1. Make sure you have the right libraries running on the server (some are
turned off by default)
2. Start SQL Browser. This is more likely to be the problem with remote
connections (on another machine)

Be careful with the master database, as messing it up can bring down your
entire business.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://www.yqcomputer.com/ #

or just read it:
http://www.yqcomputer.com/

********************************************
| Think outside the box! |
********************************************

 
 
 

connection to master fails, to northwind succeeds

Post by Gregory A. » Sun, 21 Sep 2008 09:32:25

Looking at it again, it looks like someone munged up the security on some of
the servers, or you are running the code locally. It is normal for the
master database to be protected. Do not have time to chase this gremlin
down, but you may have to destroy security to solve it.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://www.yqcomputer.com/ #

or just read it:
http://www.yqcomputer.com/

********************************************
| Think outside the box! |
********************************************
 
 
 

connection to master fails, to northwind succeeds

Post by David Thie » Mon, 22 Sep 2008 05:22:01

We're seeing this with multiple servers and in every case some clients
can do this fine against every server. So we think it's a client
problem.

All we are using this for is to get all databases on the server - so
it's to do a single select.

thanks - dave


On Fri, 19 Sep 2008 19:32:25 -0500, "Cowboy \(Gregory A. Beamer\)"




david@ XXXX@XXXXX.COM
Windward Reports -- http://www.yqcomputer.com/
me -- http://www.yqcomputer.com/

Cubicle Wars - http://www.yqcomputer.com/
 
 
 

connection to master fails, to northwind succeeds

Post by stchen » Tue, 23 Sep 2008 12:08:52

Hi Dave,

As for the behavior that some client can connect correctly with all the
servers while some others cannot, have you checked those thoses to see
whether there is any difference on the client-side connect protocols
configuration? Also, is the security context of the different clients
differs from each other? In addition, have you tried using sql profiler at
server-side(for those servers that suffer master database connection issue)
to see whether there is anything particular?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
XXXX@XXXXX.COM .

==================================================
Get notification to my posts through email? Please refer to
http://www.yqcomputer.com/ #notifications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

of
 
 
 

connection to master fails, to northwind succeeds

Post by David Thie » Wed, 24 Sep 2008 02:12:36

As far as we can tell there is no difference in the connect protocols
but we be missing something. All of the Sql tools can connect so they
show no problems - but some of the systems do not have the Sql tools
on them - we will try that.

We think the security contexct is the same on each but Windows
security is so complex now - there is no way to tell if it's identical
on each.

What else should we look for to see why it is refused by the server?
Is there some way in the server to watch the connect request and see
if it gets it, and if so, why it's refused?

thanks - dave



On Mon, 22 Sep 2008 03:08:52 GMT, XXXX@XXXXX.COM





david@ XXXX@XXXXX.COM
Windward Reports -- http://www.yqcomputer.com/
me -- http://www.yqcomputer.com/

Cubicle Wars - http://www.yqcomputer.com/
 
 
 

connection to master fails, to northwind succeeds

Post by stchen » Wed, 24 Sep 2008 12:42:25

Hi Dave,

For the SQL Server side, as I mentioned in previous post, you can try using
SQL Server Profiler tool, which can log the login and query info of each
request.

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
XXXX@XXXXX.COM .

==================================================
Get notification to my posts through email? Please refer to
http://www.yqcomputer.com/ #notifications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
onet:11259

at
issue)
Please
rights.