How to configure SQL Server 2005 to allow remote connections

来源:互联网 发布:sqlserver自增列 编辑:程序博客网 时间:2024/05/16 08:03

SOURCE: CLICK HERE

 

When you try to connect to an instance of Microsoft SQL Server 2005 from a remote computer, you may receive an error message. This problem may occur when you use any program to connect to SQL Server. For example, you receive the following error message when you use the SQLCMD utility to connect to SQL Server:

Sqlcmd: Error: Microsoft SQL Native Client: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

This problem may occur when SQL Server 2005 is not configured to accept remote connections. By default, SQL Server 2005 Express Edition and SQL Server 2005 Developer Edition do not allow remote connections. To configure SQL Server 2005 to allow remote connections, complete all the following steps:

  • Enable remote connections on the instance of SQL Server that you want to connect to from a remote computer.
  • Turn on the SQL Server Browser service.
  • Configure the firewall to allow network traffic that is related to SQL Server and to the SQL Server Browser service.

This article describes how to complete each of these steps.  

 

 

To enable remote connections on the instance of SQL Server 2005 and to turn on the SQL Server Browser service, use the SQL Server 2005 Surface Area Configuration tool. The Surface Area Configuration tool is installed when you install SQL Server 2005.

Back to the top

Enable remote connections for SQL Server 2005 Express or SQL Server 2005 Developer Edition

To create an exception for the SQL Server Browser service in Windows Firewall, follow these steps:

  1. In Windows Firewall, click the Exceptions tab, and then click Add Program.
  2. In the Add a Program window, click Browse.
  3. Click the C:/Program Files/Microsoft SQL Server/90/Shared/sqlbrowser.exe executable program, click Open, and then click OK.

    Note The path may be different depending on where SQL Server 2005 is installed.

================================================================================

 

SOMETIMES, IF YOU GET THE ERROR: 

" the fact that under the default settings SQL Server does not allow remote connections "

 

YOU SHOULD NOTICE THE CONNECTION STRING.

<add name="conStr" connectionString="server=./SQLEXPRESS;database=Demo;uid=SQL_USER_NAME;pwd=PASSWORD;"/>

 

ESPECIALLY THE RED PART.  SPECIFY THE EXACT SERVER PATH AND NAME IF YOU GET THE ABOVE ERROR WHILE USING "SERVER = . "

原创粉丝点击