0
votes

I just installed SQL Server 2005 SP2 on Vista and am attempting to connect to my object explorer in Management Studio. When doing so I get the following error:

Cannot connect to localhost.

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) (Microsoft SQL Server, Error: 2)

I am using the following credentials:

Server type: Database Engine; Server name: localhost; Authentication: Windows Authentication

I am just using SQL Server for a local application. I have tried using 127.0.0.1, my comp name, "." and localhost. I have searched and tried every relevant help topic I could find. I have reinstalled, turned on IIS (just a guess), updated to latest service packs all around, run as admin, etc.

What am I missing here?

JJ

4

4 Answers

0
votes

Try using (local)

Also if you have an instance name you can try myComputerName\instanceName

0
votes

You're missing the instance name. You don't just connect to localhost, but to any of the following (assuming that your machine is called dago and your instance sqlexpress):

localhost\sqlexpress
dago\sqlexpress
.\sqlexpress
0
votes

I am not using express. It turns out I had a "client" version of SQL Server installed. I didn't even know there was a client version. I ran the full install and added the sa user as Windows Authentication wasn't working for me (next goal). I am connecting via "localhost" (just localhost), so I don't fully understand what the instance suggestion was all about.

Basically the solution was to get the full version installed. My bad. Easy fix.

JJ