Tuesday, March 27, 2012

Connecting to SQL Server 2000 Named Instances

We are having all kinds of issues with named instances for SQL 2000.

I am trying to connect to a SQL Server 2000 named instance on a different subnet and get an error. I cannot connect with ODBC or our web app.

I am using the port number for the alias that I created in the SQL Client Utility. We can connect to default instances without a problem, but not the named instances.

The SQL Server is 2000 build 2040 (Service pack 4 with a hot fix.) The server is listening on port 1223. In the ODBC connection I click on the Network Config and create an alias with the named instance such as SQLVSN\SQLNI and specify port 1223. I have also tried adding the port to the connection string in the ASP include file (SQLVSN\SQLNI,1223). If I do the same thing with a default instance on the network, both the app and ODBC work fine. It is only when I use a named instance.

Very frustrated. Thanks for any help you can provideIt shouldn't be much different. Here is a connection string in ASP which I use for our internal webpage.


Set objConn = Server.CreateObject("ADODB.Connection")
Set objrs = Server.CreateObject("ADODB.Recordset")

objConn.Open "Driver={SQL Server};" & _
"Server=SERVERNAME\INSTANCENAME;" & _
"Database=DATABASENAME;" & _
"Network=NETWORKNAME;" & _
"Uid=USERNAME;" & _
"Pwd=PASSWORD"

str = "SELECT bla bla FROM bla bla WHERE bla bla;"
set objrs=objConn.execute(str)

I know all about security and dynamic SQL queries; this is just a proof of concept|||That's what we have. The app works on one of the servers that are on the same subnet, but not the one on a different subnet.

The one that is on the other subnet can't connect when I try to create an ODBC connection as a test. This goes for all named instances in the company, for which we have quite a few because we have several SQL Server Cluster Groups setup. However, I can create an ODBC connection to a default instance with no problem what so ever.

I have to be overlooking something when it comes to named instances.

No comments:

Post a Comment