Showing posts with label establishing. Show all posts
Showing posts with label establishing. Show all posts

Monday, March 19, 2012

Help Needed!! Error connecting to SQL 2005 EE via VB 2005 EE

System.Data.SqlClient.SqlException was unhandled
Class=20
ErrorCode=-2146232060
LineNumber=0
Message="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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
Number=2
Server=""
Source=".Net SqlClient Data Provider"
State=0

Hi guys, I have just set up a database in SQL 2005 Express Edition. However, I have a problem accessing it with the application program created in VB 2005 EE. Before using SQL 2005, the application worked perfectly in SQL 2000.
Here is my connection string used in SQL 2000:

Dim sqlConn As New SqlConnection("Data Source=(local); Database='Inventory List'; Integrated Security=yes")

Is this valid in SQL 2005 Express Edition? Or should I change the connection string instead? Thank you very much.

The normal connection string for express would be;

Dim sqlConn As New SqlConnection("Data Source=(local)\sqlexpress; Database='Inventory List'; Integrated Security=yes")

|||Did you enable remote connections for the SQL Express instance ? See the Screencast on my site for more information.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

Friday, March 9, 2012

Help needed in establishing connection

I recently migrated SQL Server 2005 which we use for our internet site and other internal applications, to it's own server. SQL used to be on the development PC. However now I am having security issues.

I keep getting an error message when I try to connect to the server from the development PC that the SQL server is not set up or does not allow remote connections. I have made sure that ASPNET is a user. I have also run aspnet_regsql to set up the internet users database.

What other security features do I need to check? I am more of a VB developer than a SQL admin so any help is appreciated.

FYI - This is a small network that does not run any form of Windows Server. I am using IIS 5.1. TCP/IP and Named Pipes is enabled.

Thanks

Additional information - I tried to telnet using the server/instance 1433 and I get this message:

Could not open connection to the host, on port 1433: Connect failed

2nd update - I turned OFF the firewall (Windows) to the SQL server and now it seems to work. I did add port 1433 as an exception so I am not sure what that is not working. And I also really do not feel comfortable in turning off the firewall. However, now it is working. I know it is not an ideal situation for SQL Server, but the machine it is running on is using XP with SP2.

|||

Take a look and see if any of the answers in this thread help you:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=268328&SiteID=1

Thanks
Laurentiu