ASP连接到SQL 2008命名实例 [英] ASP Connections to SQL 2008 Named Instance

查看:227
本文介绍了ASP连接到SQL 2008命名实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SQL 2008服务器上运行三个实例。每个实例分配一个唯一的IP地址,侦听端口1433只TCPIP已启用。

I have an SQL 2008 server running three instances. Each instance is assigned a unique IP address and listens on port 1433. Only TCPIP is enabled.

我所有的ASP.Net应用程序连接成功地使用IP地址,类似于一个连接字符串:

All of my ASP.Net applications connect successfully using the IP address, with a connection string similar to:

User ID=SQLUser;Password=userpass;Database=TestDB;Data Source=sqlserver

我的ASP应用程序只能连接到默认实例;每当我尝试连接到另一个实例我得到这个错误:

My ASP applications will only connect to the default instance; I am getting this error whenever I try to connect to another instance:

Microsoft OLE DB Provider for ODBC Drivers error '80004005' <br />
[Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection.

在ASP连接字符串是这样的:

The ASP connection strings are like this:

driver={SQL Server};server=sqlserver;uid=SqlUser; pwd=userpass; database=TestDB

我关掉Windows防火墙上的IIS和SQL Server都现在。有没有在SQL Server和IIS服务器之间的任何防火墙。 SQL浏览器是SQL Server上运行。我试图修改ASP连接字符串包括实例名称,如:

I turned off Windows Firewall on both the IIS and SQL Server for now. There's not any other firewalls between the SQL Server and the IIS server. SQL Browser is running on the SQL Server. I tried modifying the ASP connection strings to include the instance name, like:

driver={SQL Server};server=sqlserver/InstanceName;uid=SqlUser;pwd=userpass;database=TestDB

但我得到了同样的错误。

but I get the same error.

有没有办法从ASP连接到命名实例?

Is there any way to connect to a named instance from ASP?

推荐答案

写的服务器名称,像这样:

Write the server name like so:

server=sqlserver\InstanceName

此外,检查的端口号,因为它可能无法在1433。

Also, check the port number as it might not be on 1433.

相关SO问题:

  • SQL Server 2005 Named Instance port problem

这篇关于ASP连接到SQL 2008命名实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆