can't connect to SQL Server 2000

associates

New member
Joined
Sep 11, 2006
Messages
3
Programming Experience
Beginner
Hi,
I was wondering if anyone might be able to help me. I have SQL Server 2000 running on my machine and recently just intalled Visual Basic .NET 2005 Express Edition. People said it would coexist with SQL Server 2000. Today, i was trying to make use of the bindingsource provided by VB 2005 express edition so i tried to add the datasource via the data source configuration wizard. It then asks to choose data connection. i clicked on the new connection and typed in C:\Program Files\Microsoft SQL Server\MSSQL\Data\northwind.mdf as the database file name. As soon as i hit OK button, i got the following error message
"An error has occured while establishing a connection to the server. when connecting to the SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server doesnot allow remote connections. (provider: SQL Network Intefaces, error: 26 - Error locating server/instance specified).
From my understanding of the message, it looks for SQL Server 2005 and obviously it's not there. Is this mean that i can not use the VB Studio 2005 Express Edition with SQL Server 2000? how do i go about resolving this issue without having to install the SQL Server 2005? the reason for this is i'm doing this in favour of my client since they use SQL Server 2000 SP4.
Thank you in advance
 
upgrading to vs 2005 should have no effect on the sql, the issue is you are tying to connect to the file rather then the server. regardless of the version of sql you are using, the connection is almost always the same. follow these steps.

I am not sure if you are using sql express 2005, or sql server 2000, but the connection string would be as follows

"server=SERVERName/Instance" this means if my server was named server1 and the sql instance was sql2005, this would be,

One of the following, depending on whether you wanted to specify a login, or use your trusted windows login

Server=server1/sql2005;Database=northwind;Uid=sa;Pwd=12345;
Server=server1/sql2005;Database=northwind;Trusted_Connection=yes;

Please keep in mind, make sure you specify the server and instance under server name, because it sounds as if you might have installed a second instance of sql when you installed vs.net 2005, thinking you were upgrading the previous sql 2000. If that is the case only one of the instances running has the northwind database on it, so make sure you identify the correct one. If you think that you only have 1 instance of sql running then you can get away with the following connection string
Server=(local);Database=northwind;Trusted_Connection=yes;
 
ensure that the sql server browser service is started on the server machine
ensure the sql server service is started
configure the machine to allow local and remote connections over both tcp and named pipes (will come in handy later) supporting both authentication methods (windows and sql server)

interstingly, in vinnie's advice, I note that he uses a forward slash in the host/sqlserverinstance descriptor..
I use a backward slash. I'm not sure if either is acceptable or if vinnie made a typo
 
Back
Top