6 Replies - 44362 Views - Last Post: 26 February 2011 - 06:02 PM Rate Topic: -----

#1 janmichaelintia  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 12
  • Joined: 21-June 09

Connecting To a Remote SQL Server via (Internet) IP Address

Posted 10 February 2010 - 10:08 AM

Hi , i need to know what will it take for me to access, insert, update and delete data to a database on a remote SQL Server. I already made some configurations to the SQL Server 2005 that I want to access by following the steps coming from this link -> http://www.datamaske..._NetworkCfg.htm. But somehow I am still getting an error. My primary concern is "What connection string should I use on my client VB.NET application to connect to the remote SQL Server?" Since I will be connecting to the SQL Server via Internet and not by LAN, I am wondering which IP Address and Port am i going to put on the 'connection string'? How can i get my 'TRUE' Ip address? Or is there any other way to go through with this? It will be very helpful if you could share your insights and knowledge. Thanks in Advance!

Here's my sample connection string:

"Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;"

Is This A Good Question/Topic? 0
  • +

Replies To: Connecting To a Remote SQL Server via (Internet) IP Address

#2 Sethro117  Icon User is offline

  • Still the sexiest mofo.
  • member icon

Reputation: 236
  • View blog
  • Posts: 2,378
  • Joined: 14-January 09

Re: Connecting To a Remote SQL Server via (Internet) IP Address

Posted 10 February 2010 - 10:50 AM

What error are you getting?
Was This Post Helpful? 0
  • +
  • -

#3 janmichaelintia  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 12
  • Joined: 21-June 09

Re: Connecting To a Remote SQL Server via (Internet) IP Address

Posted 10 February 2010 - 11:30 AM

Here's the error i am getting :


"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. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.) (Microsoft SQL Server, Error: 10061)"

Was This Post Helpful? 0
  • +
  • -

#4 Sethro117  Icon User is offline

  • Still the sexiest mofo.
  • member icon

Reputation: 236
  • View blog
  • Posts: 2,378
  • Joined: 14-January 09

Re: Connecting To a Remote SQL Server via (Internet) IP Address

Posted 10 February 2010 - 12:07 PM

Is this a server you have access to to make config changes? If so you might try this to see how to set it up to allow remote connections. The link is for SQL Server 2005
http://support.microsoft.com/kb/914277
Was This Post Helpful? 0
  • +
  • -

#5 Guest_ram*


Reputation:

Re: Connecting To a Remote SQL Server via (Internet) IP Address

Posted 23 February 2011 - 02:49 AM

View PostSethro117, on 10 February 2010 - 12:07 PM, said:

Is this a server you have access to to make config changes? If so you might try this to see how to set it up to allow remote connections. The link is for SQL Server 2005
http://support.microsoft.com/kb/914277

thank you for ur support but its not working can you give me the detail process of it
i am in a big problem plz help me
Was This Post Helpful? 0

#6 polens  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 155
  • Joined: 09-November 09

Re: Connecting To a Remote SQL Server via (Internet) IP Address

Posted 23 February 2011 - 04:43 AM

i think the remote connection is set only to a LAN check the sql server surface area configuration...
Was This Post Helpful? 0
  • +
  • -

#7 Arazons  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 79
  • Joined: 18-March 09

Re: Connecting To a Remote SQL Server via (Internet) IP Address

Posted 26 February 2011 - 06:02 PM

View Postram, on 23 February 2011 - 03:49 AM, said:

View PostSethro117, on 10 February 2010 - 12:07 PM, said:

Is this a server you have access to to make config changes? If so you might try this to see how to set it up to allow remote connections. The link is for SQL Server 2005
http://support.microsoft.com/kb/914277

thank you for ur support but its not working can you give me the detail process of it
i am in a big problem plz help me



Enable remote connections for SQL Server 2005 Express or SQL Server 2005 Developer Edition
You must enable remote connections for each instance of SQL Server 2005 that you want to connect to from a remote computer. To do this, follow these steps:
Click Start, point to Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Surface Area Configuration.
On the SQL Server 2005 Surface Area Configuration page, click Surface Area Configuration for Services and Connections.
On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Remote Connections, click Local and remote connections, click the appropriate protocol to enable for your environment, and then click Apply.

Note Click OK when you receive the following message:
Changes to Connection Settings will not take effect until you restart the Database Engine service.
On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Service, click Stop, wait until the MSSQLSERVER service stops, and then click Start to restart the MSSQLSERVER service.

Enable the SQL Server Browser service
If you are running SQL Server 2005 by using an instance name and you are not using a specific TCP/IP port number in your connection string, you must enable the SQL Server Browser service to allow for remote connections. For example, SQL Server 2005 Express is installed with a default instance name of Computer Name\SQLEXPRESS. You are only required to enable the SQL Server Browser service one time, regardless of how many instances of SQL Server 2005 you are running. To enable the SQL Server Browser service, follow these steps.

Important These steps may increase your security risk. These steps may also make your computer or your network more vulnerable to attack by malicious users or by malicious software such as viruses. We recommend the process that this article describes to enable programs to operate as they are designed to, or to implement specific program capabilities. Before you make these changes, we recommend that you evaluate the risks that are associated with implementing this process in your particular environment. If you choose to implement this process, take any appropriate additional steps to help protect your system. We recommend that you use this process only if you really require this process.
Click Start, point to Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Surface Area Configuration.
On the SQL Server 2005 Surface Area Configuration page, click Surface Area Configuration for Services and Connections.
On the Surface Area Configuration for Services and Connections page, click SQL Server Browser, click Automatic for Startup type, and then click Apply.

Note When you click the Automatic option, the SQL Server Browser service starts automatically every time that you start Microsoft Windows.
Click Start, and then click OK.
Note When you run the SQL Server Browser service on a computer, the computer displays the instance names and the connection information for each instance of SQL Server that is running on the computer. This risk can be reduced by not enabling the SQL Server Browser service and by connecting to the instance of SQL Server directly through an assigned TCP port. Connecting directly to an instance of SQL Server through a TCP port is beyond the scope of this article. For more information about the SQL Server Browser server and connecting to an instance of SQL Server, see the following topics in SQL Server Books Online:
SQL Server Browser Service
Connecting to the SQL Server Database Engine
Client Network Configuration

Create exceptions in Windows Firewall
These steps apply to the version of Windows Firewall that is included in Windows XP Service Pack 2 (SP2) and in Windows Server 2003. If you are using a different firewall system, see your firewall documentation for more information.

If you are running a firewall on the computer that is running SQL Server 2005, external connections to SQL Server 2005 will be blocked unless SQL Server 2005 and the SQL Server Browser service can communicate through the firewall. You must create an exception for each instance of SQL Server 2005 that you want to accept remote connections and an exception for the SQL Server Browser service.

SQL Server 2005 uses an instance ID as part of the path when you install its program files. To create an exception for each instance of SQL Server, you must identify the correct instance ID. To obtain an instance ID, follow these steps:
Click Start, point to Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Configuration Manager.
In SQL Server Configuration Manager, click the SQL Server Browser service in the right pane, right-click the instance name in the main window, and then click Properties.
On the SQL Server Browser Properties page, click the Advanced tab, locate the instance ID in the property list, and then click OK.
To open Windows Firewall, click Start, click Run, type firewall.cpl, and then click OK.
Create an exception for SQL Server 2005 in Windows Firewall
To create an exception for SQL Server 2005 in Windows Firewall, follow these steps:
In Windows Firewall, click the Exceptions tab, and then click Add Program.
In the Add a Program window, click Browse.
Click the C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe executable program, click Open, and then click OK.

Note The path may be different depending on where SQL Server 2005 is installed. MSSQL.1 is a placeholder for the instance ID that you obtained in step 3 of the previous procedure.
Repeat steps 1 through 3 for each instance of SQL Server 2005 that needs an exception.
Create an exception for the SQL Server Browser service in Windows Firewall
To create an exception for the SQL Server Browser service in Windows Firewall, follow these steps:
In Windows Firewall, click the Exceptions tab, and then click Add Program.
In the Add a Program window, click Browse.
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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1