Craig
Craig

Reputation: 3297

How to connect to SQL Server 2000 database from Visual Studio 2012

I have a SQL Server 2000 database that I need to access from Visual Studio 2012. Needless to say the data provider for SQL Server requires SQL Server 2005 or above, and the data provider for OLE, which claims to support SQL Server 2000 or above, says "SQL Server Native Client 11.0 does not support connections to SQL Server 2000 or earlier versions."

Is there some kind of plug-in I can install that will let me access SQL Server 2000?

Eventually my app will live ON the server itself. Is it going to need something special to access this older database?

Upvotes: 2

Views: 12111

Answers (2)

Nick Kennedy
Nick Kennedy

Reputation: 12640

This is possible using the GUI also. I'm using Visual Studio 2013, but I suspect the same is true for 2012.

In the 'Add Connection' window, there's an 'Advanced' button at the bottom of the window. Within this, even for OLEDB the default provider seems to be 'SQLNCLI11'. However, it can be changed to 'SQLOLEDB' and then it should work even with SQL Server 2000.

OLEDB window

Upvotes: 3

fabricio
fabricio

Reputation: 1393

... and you can't use Entity Framework...

However, you'll have to create a connection string like this:

 String sConexion = "Asynchronous Processing=true;"
                    + " Pooling=false;User ID=" + user + "; "
                    + " password= " + password + "; "
                    + " Initial Catalog=" + database + "; "
                    + " Data Source=" + server;// + ",1433";
SqlConnection conexion = new SqlConnection(sConexion);
conexion.Open();

You can get some reference from here ConnectionStrings

Upvotes: 3

Related Questions