Monday, 10 January 2011

SQL SERVER – FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: )

Few days ago, I had redone my local home network. I have LAN setup with wireless router connected with my four computers, two mobile devices, one printer and one VOIP solution. I had also formatted my primary computer and clean installed SQL Server 2008 into it. Yesterday, incidentally, I was sitting in my yard trying to connect SQL Server located in home office and suddenly I stumbled upon the following error. Finding the solution was the most infuriating part as it consumed my precious 10 minutes.

Let us look at few of the common errors received:

An error has occurred while establishing a connection to the server.

(provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 5)

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) (Microsoft SQL Server, Error: 1326)

I eventually found the resolution to this error on this blog itself; so I was saved from hunting for the solution. I am sure there are a number of developers who had previously fixed this error while installing SQL Server 2008 or SQL Server 2005 but in due course forgot the right solution to this error. This is just a quick refresher. Make sure to bookmark this as you never know when you would need this solution.

Let us check into the steps to resolve this error.

1) SQL Server should be up and running.

Go to All Programs >> Microsoft SQL Server 2008 >> Configuration Tools >> SQL Server Configuration Manager >> SQL Server Services, and check if SQL Server service status is “Running”.

In addition, ensure that your remote server is in the same network. Run “sqlcmd -L” in your command prompt to ascertain if your server is included in your network list. You can even find tutorial for the same here SQL SERVER – Find All Servers From Local Network – Using sqlcmd – Detect Installed SQL Server on Network.

I have confronted numerous situations when these nerve-wracking errors crop up, and most of the time when I try to troubleshoot I notice that SQL Server services are neither running nor installed. If SQL Server is not installed as default instance SQL Server Browser should be running together with it; we will explore this further in Topic 5.

2) Enable TCP/IP in SQL Server Configuration

When two or more SQL Servers are connected across network they do all communication using TCP/IP. The default port of SQL Server installation is 1433. This port can be changed through SQL Server Configuration Manager. TCP/IP should be enabled for SQL Server to be connected.

Go to All Programs >> Microsoft SQL Server 2008 >> Configuration Tools >> SQL Server Configuration Manager >> Select TCP/IP

Right Click on TCP/IP >> Click on Enable

You must restart SQL Server Services for all the changes to take effect. Right click and go to menu properties to select location where default port of SQL Server can be changed.

3) Open Port in Windows Firewall

Windows Firewall is very efficacious in protecting the Operating system from all sorts of malicious attacks. By default, many of the ports and services are refrained from running by firewall. Time and again, SQL Server ports are not open in firewall as well. All the ports on which SQL Server is running should be added to exception and firewall should filter all the traffic from those ports. As described, by default SQL Server runs on port 1433, but if default port is changed then the new port should be added to exception. If SQL Server has named instance (another instance besides default instance) is installed, SQL Server browser should also be added to the exception, as described in Step 7.

Go to Control Panel >> Windows Firewall >> Change Settings >> Exceptions >> Add Port

Make the following entries in popup “Add a Port” and click OK.
Name : SQL
Port Number: 1433
Protocol: Select TCP

4) Enable Remote Connection

Enabling remote connection is another important, yet oft-neglected step that is frequently missed by database administrators while setting up SQL Server. If this feature is turned off SQL Server will function smoothly on local machine, but it will let another server connect to it remotely. By default this feature is ON in SQL Server 2008.

Right click on the server node and select Properties.

Go to Left Tab of Connections and check “Allow remote connections to this server”

5) Enable SQL Server Browser Service

If SQL Server is not installed as default instance but instead installed as named instance and also if there is no specific TCP/IP port configured, it will give rise to the error that is being discussed in this article. If SQL Server Browser service is enabled, it will allow the server to be connected through dynamic TCP/IP port. Enabling this service is a one-time process, as on enabling it once it will apply to all the instances installed on the same server.

Go to All Programs >> Microsoft SQL Server 2008 >> Configuration Tools >> SQL Server Configuration Manager >> SQL Server Browser

Right Click on SQL Server Browser >> Click on Enable

6) Create exception of sqlbrowser.exe in Firewall

As elucidated in Step 6, sqlbrowser service needs to be enabled for named instance. Windows Firewall may prevent sqlbrowser.exe to execute. So, it is imperative to add exception for the same in windows firewall.

Search for sqlbrowser.exe on your local drive where SQL Server is installed. Copy the path of the sqlbrowser.exe like C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe and create the exception of the file in Firewall, as delineated in Step 3.

7) Recreate Alias

It is getting quite common to create alias of SQL Server and use it in application. This will ensure that in future if any physical SQL Server has to be moved, it will not be required to change any code or connection string. You can simply create alias with the same name pointing to different SQL Server and it will start working instantaneously. I have observed that a couple of times due to internal error while recreating alias this error was fixed.

Go to All Programs >> Microsoft SQL Server 2008 >> Configuration Tools >> SQL Native Client 10.0 Configuration >> Aliases

Delete the alias that is giving problem and recreate it with identical parameters.

I have tried my best to include all the methods of fixing this error and if I have missed any, please leave a comment and I will be very glad to include them here. I have put in my effort to encompass this issue in one article that needs to be refereed when any connection error comes up.

Reference : Pinal Dave (http://blog.SQLAuthority.com)

Access violation at address 10002593 in Module 'LIBMYSQL.dll'

When you install WinMySQLAdmin with MySQL and start WinMySQLAdmin you end with this error. Every time you start the control application you get a warning which is repeated until WinMySQLAdmin is shut down.

Access violation at address 10002593 in Module 'LIBMYSQL.dll'
Repeating the Error

Start WinMySQLAdmin with the xampp and you should get the error again.

Solution

1. Open WinMySQlAdmin
2. Click on the my.ini Setup tab
3. Change the following entries

user=root
password=password

to

user=
password=

Another simple solution is to locate my.ini in your windows directory and make the below changes:

user=root
password=password

to

user=root
password=


This should resolve the error. If not, let me know and I will try my best to get you another solution. :)

FTP ECONNREFUSED – Connection refused by server Error

While attempting to upload to a file using FileZilla the other day I ran into this error message “ECONNREFUSED – Connection refused by server”. It never seems to fail that, when I am moving right along, up pops an issue I need to figure out or am unfamiliar with.

After going through the motions of changing my passwords, as well as some other steps, I finally gave up, left the computer and began to stew about it. I tried to figure out what had recently changed on my system that would cause this to happen, since it was not occurring before.

The few changes I had made was installing SEO Quake in Firefox and an update was done with my virus software which is McAfee (which by the way if anyone can recommend a better, more secure anti-virus, I am all ears). I decided to play around with these two things to see if either one was the issue. By uninstalling SEO Quake there was no change, however by disabling the firewall on McAfee I was finally able to connect.

I have used McAfee for quite some time and have always had my firewall up, so I am not sure why the change now. However, it did solve the problem and I was able to upload my files.

I always like to post any issues I bump into while working online whether it is working with working with sites, internet marketing, or anything else that might come up. I post these in attempt to assist others or if anyone else has found any fixes I would love to hear them.

Filezilla ECONNREFUSED Connection refused by server

If you are a Filezilla user for all your FTP needs then you may have faced this error. When you try to connect to your web host using Filezilla, you get this error "ECONNREFUSED - Connection refused by server". When I first got this error, I ran around from my ISP to my web host to get a solution. All the suggestions from my ISP, my web host and filezilla failed.

I just decided to take a step back to figure out when & how this problem had started. I had recently updated my filezilla and thought probably this was a bug with the new version. I tried installing the previous version but ended up with the same error. The only other thing I had done was to upgrade my zonealarm. Then it stuck me, that when my zone alarm was being upgraded, the firewall was shut down for some time. Thats when the windows firewall has automatically started without my knowledge.

Even after zone alarm had been upgraded, the windows firewall was still on. Effectively I had two firewalls running on my machine. Even with the Filezilla executable listed in the exceptions list for windows firewall, it was still being blocked.

I turned off my windows firewall and voila, filezilla was immediately able to connect. So the real culprit behind my entire ordeal was windows firewall.

I was also surprised to see incorrect error by Filezilla. If Filezilla had reported that it was being blocked by a firewall, it would have saved me a lot time. Instead the error was "Connection refused by server".

Hope this helps you to resolve your problem as well.

How to Enable Remote errors on SQL reporting services.

If you have been using SQL reporting services, you may have encountered few errors which just become difficult to resolve. In such cases, its advisable to enable the remote errors on your reporing services which helps you to understand the inner exceptions.

The remote errors can be enabled on the reporting services in two ways:

1. Using the SQL Server Management Studio

Start Management Studio and connect to a report server instance.
Right-click the report server node, and select Properties.
Click Advanced to open the properties page.
In EnableRemoteErrors, select True.
Click OK.

2. Using a script to enable remote errors:

a. Create a text file and copy the following script into the file.

Public Sub Main()
Dim P As New [Property]()
P.Name = "EnableRemoteErrors"
P.Value = True
Dim Properties(0) As [Property]
Properties(0) = P
Try
rs.SetSystemProperties(Properties)
Console.WriteLine("Remote errors enabled.")
Catch SE As SoapException
Console.WriteLine(SE.Detail.OuterXml)
End Try
End Sub

b. Save the file as .rss in your local folder.
c. Open a command prompt window
d. Either Navigate to the directory that contains the .rss file you just created or use the absolute file location on the command prompt. Type the following command line, replacing servername with the actual name of your server:

rs -i EnableRemoteErrors.rss -s http://servername/ReportServer

3. Enabling the remote errors by updating the database.

a. Update ReportServer database Configuration table for EnableRemoteErrors

Update the ConfigurationInfo table in the ReportServer database for configuration record named "EnableRemoteErrors". The default value for EnableRemoteErrors property in the ConfigurationInfo database table is "False". Update the value to true by running a simple update statement.

You may not be successful to see the changes made on the ConfigurationInfo table on the Reporting Services application, if the application is being used intensely.

If everything goes fine, you should see a message "remote error enabled."

Note: Do ensure that your server is accessible from the location / machine you run the script from. If you have direct access to the server, run the script on the server.

Enabling the remote errors should give you detailed information on all the issues you encounter on your reporting services.

Concurrency in Ada Ada is renown for its concurrency support. Parallel programming is a difficult issue in all aspects. It is difficult to learn, to d

Concurrency in Ada

Ada is renown for its concurrency support. Parallel programming is a difficult
issue in all aspects. It is difficult to learn, to design, to program, to validate, but
for all, it is most difficult to reuse.

Yesterday I finished the version 3.0 of the Simple Components for Ada, where I tried
to summarize my experience and ideas in this area. The library among other things
contains some basic gears for dealing with concurrency.

The section 9 is devoted to implementation of some lock-free data
structures. These become more popular with new multi-core architectures.
Though Ada was not designed to provide lock-free primitives on the low-level,
for that obvious reason that this would be non-portable. It still has necessary
tools. Here I mean the pragma Atomic, which allows many interesting things to do.

The section 10 contains implementations of locking synchronization primitives.
Protected objects introduced in Ada 95 is an excellent mechanism of a great
power. Especially interesting is to explore the requeue statement. Events,
pulse events, arrays of events, mutexes, arrays of mutexes let be implemented
as protected objects. Using the requeue statement one can do a lot of things,
which appear impossible at the first glance. For example, this section
presents a programming pattern for using entry parameters in the barriers of.
It also discusses how race condition and deadlocks can be avoided when using
protected objects.

Two classical problems are considered on examples: the checkpoint
synchronization problem, and the dining philosophers one.

It is free as only it can be, the license is GMGPL I hope you will enjoy it.

http://www.dmitry-kazakov.de/ada/components.htm

The Henn and Egg problem Over time I have created GNAT compiler for a variety for of platforms and one thing I noticed is the constant encounter of H

The Henn and Egg problem

Over time I have created GNAT compiler for a variety for of platforms and one thing I noticed is the constant encounter of Hen and Egg situation. — At least when you leave the save heaven of Linux. Below some examples:

Texinfo and libiconv

A classic one: The compiler needs Texinfo to create it's online help and you need an working compiler to create Texinfo. Ahh, and Texinfo needs libiconv and libiconv needs a working C++ compiler.

But these problems is easily solved since online help is only optional extra.

Buinutils

Similar to Texinfo only a little trickier as a working assembler and linker are an absolute must. And don't expect every platform to come with a sufficiently up-to-date assembler or linker — Solaris springs to my mind here.

C++

C++ is an integral part of GCC compiler and needed by libiconv. But that is not the problem. The problem is that the C++ build expect the C header file to exist at prefix/include. Of course they only exist there after make install.

Ada

For us Ada users the worse one: Ada is self hosted. Being self hosted is of course very cool indeed: About 95% of the Ada compiler and runtime are written in Ada. I do pity the poor GNU-Fortran maintainer where most of the compiler and runtime is written on C — Yuck.

Of course that coolness comes for a price: You need a working Ada compiler to build the Ada compiler.

Resume

Why am I telling you all that? Now, if you are planning to build a newer compiler / tool chain for any platform apart from an up to date Linux you should – from the very onset – expect to build the compiler more then once. In fact: plan for 3 to 4 successful iterations (and an uncounted amount of unsuccessful iterations). Start off with just C and Ada, add other languages later. Don't worry if for example Texinfo is reported to old, Create a newer version later and try again. And remember that libiconv needs an up to date C++ compiler.