Error while trying to establish connection to SQL Server from MSVS2008

  • Thread starter Thread starter S_K
  • Start date Start date
S

S_K

Hi,

I hope you can help me with this I've been working on this all day!
I've just installed Visual Studio 2008 on my laptop, SQL Server 2005
was a part of this install (on the same laptop). When I tried to
create a connection to this database engine I got the 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 connectin to SQL Server)

I've tried to configure the Remote connections to accept named pipes
and TCP/IP but that seems to do no good.

Is there something I'm missing here? SQL Server is running and it's on
the same machine so there can't be a network error.

Thanks for your help!

Steve
 
S_K said:
Hi,

I hope you can help me with this I've been working on this all day!
I've just installed Visual Studio 2008 on my laptop, SQL Server 2005
was a part of this install (on the same laptop). When I tried to
create a connection to this database engine I got the 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 connectin to SQL Server)

I've tried to configure the Remote connections to accept named pipes
and TCP/IP but that seems to do no good.

Is there something I'm missing here? SQL Server is running and it's on
the same machine so there can't be a network error.

Thanks for your help!

Steve
It's somewhere in the config manager, but check to see that local
connections are turned on. I had the same problem with 2005 and 2008 when I
first started.
 
Andy B. said:
It's somewhere in the config manager, but check to see that local
connections are turned on. I had the same problem with 2005 and 2008 when
I first started.

SQL Server defaults to disabling TCP/IP connections and Named Pipe
connections. You need to enable the connection type(s) you want in SQL
Configuration Manager. If you want to allow access from other machines you
probably need to open the necessary ports in the Windows firewall.
 
SQL Server defaults to disabling TCP/IP connections and Named Pipe
connections. You need to enable the connection type(s) you want in SQL
Configuration Manager. If you want to allow access from other machines you
probably need to open the necessary ports in the Windows firewall.- Hide quoted text -

- Show quoted text -

OK,

I have used the Configuration Manager and set in the Log on tab "Log
in as:" Built in account and Local system.
I have also used the Surface Area Configuration Manager to set the
SQLSERVER Engine's remote connections to TCP-IP and Named pipes.
I only want to access this SQLEXPRESS database from this (local)
machine so I don't care much about remote connections.

So I restarted the database engine and I still get the same error
message!
Ideas? Does Microsoft have tech support for installation of Visual
Studio 2008 Professional Edition???
 
SQL Server defaults to disabling TCP/IP connections and Named Pipe
connections. You need to enable the connection type(s) you want in SQL
Configuration Manager. If you want to allow access from other machines you
probably need to open the necessary ports in the Windows firewall.- Hide
quoted text -

- Show quoted text -

OK,

I have used the Configuration Manager and set in the Log on tab "Log
in as:" Built in account and Local system.
I have also used the Surface Area Configuration Manager to set the
SQLSERVER Engine's remote connections to TCP-IP and Named pipes.
I only want to access this SQLEXPRESS database from this (local)
machine so I don't care much about remote connections.

So I restarted the database engine and I still get the same error
message!
Ideas? Does Microsoft have tech support for installation of Visual
Studio 2008 Professional Edition???

1. Go to start>Microsoft SQL Server 2008>Configuration tools>SQL Server
configuration.
2. Go to SQL Server configuration(Local)>SQL Server network
configuration>Protocols for SQLEXPRESS.
3. In the list of protocols, make sure that shared memory is enabled, TCP/IP
is enabled and Named pipes is enabled.
4. In the tree, go to SQL Server services and make sure that SQLEXPRESS is
running automatically by logging into the nt authority\Network Service
account. This is essential because the server wont even run if this isn't
set up right. [found this out from bad experiences].
5. If you have SQL Server with advanced services, make sure the fulltext
deamon launcher is enabled and set to auto start from nt authority\network
service.
6. Make sure SQL Server browser is enabled and set to auto start from nt
authority\network service account. This makes it possible to not need port
numbers in connection strings.
7. When all changes are made, restart your computer.
8. When computer starts, start SSMS.
9. decide if you want to use the built in SA account, you want to create an
sql login or use your windows account for access to the server.
10. Whichever one you decide, make sure it is secure. I.E. it can't be
tampered with from the outside (or inside depending on your circumstances).
-If using SA, just sign in with that username and password.
- If creating a username/password, give it SA rights.
- if using windows login username/password, create the windows username in
the server and give it SA rights.
11. Ultimately, you should only give the user you will use just enough
rights to get the job done. You also might want to create username/passwords
with different levels so you can test different contexts of your databases.
12. You should be good to go.
13. Use computerName\InstanceName as the servername when connecting with
SSMS or in your connection strings.
 
OK,

I have used  the Configuration Manager and set in the Log on tab "Log
in as:" Built in account and Local system.
I have also used the Surface Area Configuration Manager to set the
SQLSERVER Engine's remote connections to TCP-IP and Named pipes.
I only want to access this SQLEXPRESS database from this (local)
machine so I don't care much about remote connections.

So I restarted the database engine and I still get the same error
message!
Ideas? Does Microsoft have tech support for installation of Visual
Studio 2008 Professional Edition???

1. Go to start>Microsoft SQL Server 2008>Configuration tools>SQL Server
configuration.

Well, he didn't say about "Microsoft SQL Server 2008". He installed
2005 bundled with VS.NET
 
Hi,

I hope you can help me with this I've been working on this all day!
I've just installed Visual Studio 2008 on my laptop, SQL Server 2005
was a part of this install (on the same laptop). When I tried to
create a connection to this database engine I got the 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 connectin to SQL Server)

I've tried to configure the Remote connections to accept named pipes
and TCP/IP but that seems to do no good.

Is there something I'm missing here? SQL Server is running and it's on
the same machine so there can't be a network error.

Thanks for your help!

Steve

Look at the following post
http://www.sqlmusings.com/2009/03/1...hile-establishing-a-connection-to-sql-server/

Hope this helps
 
OK,

I have used the Configuration Manager and set in the Log on tab "Log
in as:" Built in account and Local system.
I have also used the Surface Area Configuration Manager to set the
SQLSERVER Engine's remote connections to TCP-IP and Named pipes.
I only want to access this SQLEXPRESS database from this (local)
machine so I don't care much about remote connections.

So I restarted the database engine and I still get the same error
message!
Ideas? Does Microsoft have tech support for installation of Visual
Studio 2008 Professional Edition???

1. Go to start>Microsoft SQL Server 2008>Configuration tools>SQL Server
configuration.

Well, he didn't say about "Microsoft SQL Server 2008". He installed
2005 bundled with VS.NET

blah... It's practlically the same thing...
 
Back
Top