We don't have enough information to solve the problem, Gary. You see this
post a lot because it is a very generic error message that is appropriate
for dozens of different problems.
Aaron:
I have xp pro and and Server2003 machines running in the same workgroup.
They can all see each other via folder shares, pings, etc. I'm running sql
server 2005 on most of them but I always get this message when I try to
connect using a connection string that works when it's on the local machine.
on the xp pro machines the db owner is machinename/aspnet. on server2003
the db owner is nt authority\network service. I am trying to connect via
asp.net website code in .net.
It all worked great until I went from sql 2000 to sql 2005.
What else do you need to know?
Gary
> We don't have enough information to solve the problem, Gary. You see this
> post a lot because it is a very generic error message that is appropriate
[quoted text clipped - 11 lines]
>> Thanks,
>> Gary
Aaron Bertrand [SQL Server MVP] - 26 Mar 2008 22:11 GMT
> I have xp pro and and Server2003 machines running in the same workgroup.
> They can all see each other via folder shares, pings, etc. I'm running
> sql server 2005 on most of them but I always get this message when I try
> to connect using a connection string that works when it's on the local
> machine.
Does the connection string use machine name, IP address, etc.?
> on the xp pro machines the db owner is machinename/aspnet. on server2003
> the db owner is nt authority\network service. I am trying to connect via
> asp.net website code in .net.
Have you considered using SQL authentication instead of Windows
authentication? Are you sure ports 1433 and 1434 are reachable between
machines (you can test this by trying to telnet)? This could be blocked by
Windows-based firewall on either or both machines, or maybe by a hardware
firewall within your network.
> It all worked great until I went from sql 2000 to sql 2005.
By default, 2005 is a little more locked down than 2000. This is because
slammer taught them a few things about leaving SQL services wide open and
exposed. I assume you have enabled remote connections for both TCP/IP and
named pipes via the surface area configuration tool?
densial - 26 Mar 2008 23:41 GMT
> Aaron:
> I have xp pro and and Server2003 machines running in the same workgroup.
[quoted text clipped - 26 lines]
> >> Thanks,
> >> Gary
try adding ",1433" to the end of the connection string, I had this
exact same issue before, I spent a while trawling the net and found
out why I might need to do this (something about firewalls and
callback ports and lots of big interweb words), the reasonmade total
sense at the time but now eludes me.
Charles Wang[MSFT] - 27 Mar 2008 06:42 GMT
Hi Gary,
There are many factors which would cause the connection error. Look at your
issue, I recommend that you first check the following conditions and let us
know the results:
1. Check if remote connections for both TCP/IP and Named Pipes is enabled
Click Start->All Programs->Microsoft SQL Server 2005->Configuration
Tools->SQL Server Surface Area Configuration->Surface Area Configuration
for Services and Connections, expand <instance name>->Database Engine and
select Remote Connections, then you can find "Local and remote connections"
at the right pane, select "Using both TCP/IP and named pipes" if it is not
selected.
2. Check if the listening port of your SQL Server instance is blocked.
Click Start->All Programs->Microsoft SQL Server 2005->Configuration
Tools-> SQL Server Configuration Manager->SQL Server 2005 Network
Configuration->Protocols for <instance name>, ensure that the TCP/IP
protocol and Named Pipes protocol are enabled, then double click the TCP/IP
protocol, switch to the IP Addresses tab, and you can find the in use TCP
port at the bottom of the IPAll section.
Then run firewall.cpl from command line to see if the TCP port is added
to the Exceptions list.
3. Check if you can telnet to your SQL Server 2005 listening TCP port from
your client machine.
Assume that the TCP port is 1433, you can run "telnet <remote server
name> 1433" to see if you can connect to the endpoint.
4. Check if the SQL Browser services is started
Run Services.msc from command line to see if SQL Browser Services is
started. If not, start it and open your firewall to add the program
(sqlbrowser.exe) to the Exceptions list.
5. Check if you can manually connect to your SQL Server instance via a SQL
login.
To do this, you may first set your SQL Server 2005 Server
Authentication mode to "SQL Server and Windows Authentication mode" which
you can find at Server Properties window by right clicking the server name
and clicking Properties on the shortcut menu in SQL Server Management
Studio. Then run "osql -S <servername>\<instancename> -U <username>
-P<password>" from command line.
Also I would like to ask you the following questions:
1. What is your connection string in your ASP.NET applicationi?
2. I am not familiar with ASP.NET, however could you please let me know why
you set machinename/aspnet and NT AUTHORITY\NETWORK SERVICE as the db owner
of your database?
Look forward to your response. Please feel free to let us know if you have
any other questions or concerns.
Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
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: msdnmg@microsoft.com.
=========================================================

Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
GaryDean - 29 Mar 2008 01:56 GMT
Charles,
This list of actions here is very valuable. I have never seen it all put
together before. I took all of these steps and some things needed changing.
After it all, I can now remotely connect. I did find that there is no
telnet on my Vista Ultimate machine - the command was unknown.
In asp.net applications it has been a common practice to have asp.net be the
user of the database as it did not require a password in the connection
string. On server2003 it's called nt authority\network service and on xp
asp.net. However now that we can easily encrypt the connection strings in
the web.config files there is no reason I know of to continue that practice.
From now on I will likely use sql server authentication so I won't care what
operating system the database is on.
You have been a great help. Thanks so much for your time and attention.

Signature
Regards,
Gary Blakely
Dean Blakely & Associates
www.deanblakely.com
> Hi Gary,
> There are many factors which would cause the connection error. Look at
[quoted text clipped - 65 lines]
> rights.
> =========================================================
Charles Wang[MSFT] - 31 Mar 2008 09:54 GMT
Hi Gary,
Appreciate your update and response.
I am glad to hear that the suggestions are helpful. If you have any other
questions or concerns, please do not hesitate to contact us. It is always
our pleasure to be of assistance.
Have a nice day!
Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
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: msdnmg@microsoft.com.
=========================================================

Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
Norman Yuan - 27 Mar 2008 15:46 GMT
I assume you are yalking the error message when connecting to a SQL
Server2005/Express fails.
Since SQL Server2005/express is the first version of SQL Server having
default installation disabled remote connection, thus, MS made such "extra
detailed" error message. But you should not limit your thought in that box,
especially when you already know that you have enabled the SQL
Server/Express' remote connection (through "SQL Server Surface Area
Configuration"). That is, unless you haven't enable remote connection, then
do it. I f you have done that (no harm to double-check, though), you need to
look into something else, such as wrong server/database name, or wrong port
number in ConnectionString, current user does not have logging
permission..., just regard that error message as connection falure message
and do your trouble shooting.
That is, disabled remote connection is just one of the reasons you cannot
connect to SQL Server, there are more other reasons you need to learn. That
error message is more useful to users who were familiar to SQL Server2000 to
give them an extra prompt to the new default SQL Server 2005 setting.
> Aaron:
> I have xp pro and and Server2003 machines running in the same workgroup.
[quoted text clipped - 26 lines]
>>> Thanks,
>>> Gary