Monday 10 January 2011

When trying to connect to through filezilla I get the error 'Connection attempt failed with "ECONNREFUSED - Connection refused by server". I bypassed

When trying to connect to through filezilla I get the error 'Connection attempt failed with "ECONNREFUSED - Connection refused by server".

I bypassed the router, disabled all firewalls, and everything else I could think of. I eventually installed the program on my wife's laptop and it works perfect with the exact same program settings I have on mine.

What else could this problem be caused by?
The answer is that
Sounds to me like you have the wrong username or password. Servers will refuse connections if the correct user and password are not entered.
or
The ONLY reasons an FTP server will refuse the connection (other than the IP being blocked, which isn't the case here) is the wrong username or the wrong password (or both), or the initial directory is one you don't have access to

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.

Virtual sizeof Do you ever wish you could do this:

Virtual sizeof

Do you ever wish you could do this:
class Base
{
};

class Derived: public Base
{
int x;
};

Base *p = new Derived;

size_t s = sizeof(*p); // s is sizeof(Derived)
Of course it doesn't work because s becomes the size of Base rather than Derived. What you really want is a kind of "virtual sizeof". This is what I came up with:
class Base
{
public:
virtual size_t Size() const = 0;
};

class Derived: public Base
{
int x;
};

template <>
class Wrapper: public T
{
public
virtual size_t Size() const
{
return sizeof(T);
}
};

template <>
T *New()
{
return new Wrapper<>;
}

Base *p = New();

size_t s = p->Size(); // works as desired

Generating XHTML MP (WAP 2.0) Pages From PHP

XHTML Mp Webpage Generation Using PHPMaybe you guys know that I've been working on a service called MyWapBlog.com which lets peoples create/manage mobile blogs using their mobile phones. In the course of the development I've learnt great deal about mobile websites and their dynamic generation, and I'm sharing a bit of it here in this post.

How do you generate dynamic (X)HTML Pages using PHP? Simple:









Sometitle





Hello



echo date('h:i A, j-M-y'); ?>







And if you look at XHTML MP pages, their source look like the following:











...

...

So you see these pages have a different document type and some other differences. So will the following code work and generate a valid WAP 2.0 page?:









Sometitle





Hello



echo date('h:i A, j-M-y'); ?>





The answer is “NO”? Why? Because XHTML MP pages needs to be served with a different Content-Type than what is generated by .PHP files. Normally when you runa s PHP script and it outputs something, the content is served with Content-Type: text/html

What is Content-Type?

It is a header (information about a particular resource) returned to browser when it requests something from a server. When you request an image, the server return the image with the header image/png, image/jpeg etc. letting the browser know how the returned content is to be interpreted.

PHP scripts can return contents of any type (using the header() function), from text to images and PDFs to ZIPs. And therfore if we want to generate XHTML MP pages, it can even do that without doubt.

So what we need to do is, just change the above code a bit adding a new line at the top so that the whole code look like the following:



("Content-type: application/vnd.wap.xhtml+xml; charset=UTF-8");?>









Sometitle





Hello



echo date('h:i A, j-M-y'); ?>





This will tell the browser that the content we are going to serve is of the type XHTML MP. We always use the charset UTF-8 for these pages, which is also told to the requesting browser.

Now the big question is, why we didn't do this for normal HTML pages. Why didn't we have to tell the browser that content is of the type “text/html” when it was so? Because PHP does it for us! Yes whenever we output anything from PHP scripts, the PHP interpreter outputs the default header (text/html) automatically. Just as the PHP interpreter finds anything in the script that needs to be output, it first generates a header, the outputted content follows. For example in the first script, the very first line (very first character “<”) needs to be output to the browser. So before that, the PHP interpreter sends a content type header (default – text/html).

Therefore, when we had to output our content with a different header we had to make sure that it is done before PHP does it automatically. Two headers cannot be valid.

This is it for this post, do check back soon for more new posts. Till then, good bye!

Deigning a Simple HTML Menu-Bar Using CSS

Deigning a Simple HTML Menu-Bar Using CSS

In this post I’m going to show how you can create a menu-bar (list of hyperlinks) using CSS styling. This requires that you at least have some basic knowledge of HTML and preferably CSS too. If you can’t figure out what a menu-bar looks like, scroll to the bottom.

Seen! Though pretty much the same can be implemented using tables but that is not web developers prefer.

In HTML there is not standard tag for creating a menu like item therefore we would be customized or style a standard tag. We’ll be using the ‘unordered list’

    tag to do so, in this case every item i.e.
  • will be items in the menu.

    Let us first start by creating an unordered list as follows:



    • Item 1


    • Item 2


    It shows up something like below:

    • Item 1
    • Item 2

    Obviously this is not what we want; items here are displaying Bullets and are one below the other while we want them to be in one line, one after the other. To achieve this we’ll style his ‘unordered list’ by defining a CSS class, then applying it to this tag.













    Here we have defined a CSS class in between the tags. It contains the property list-style: none for the

      tag, this would make the unordered list classified by menu class to NOT to display the bullets beside each item.

      • Item 1
      • Item 2

      Great! And by the way if you don’t know what a CSS class is, for now you can think of it as a way of defining properties in CSS which could be used in HTML to classify different parts or tags to have properties as defined. You can see in the above code we have used

      to classify that portion and all the tags between it to have the special property defined in CSS.

      Coming to the menu bar, it still has a big problem that it doesn’t look like a Menu. Well the same list would look like a menu if we style it, for this we would have to define display: inline for the

    • tag of the unordered list. This would make the items in the list to be in ONE line hence look like a Menu.













      Menu bar would look like:

      • Item 1
      • Item 2
      • Item 3
      • Item 4

      Ok now our menu bar is almost done, now we just have to make it more attractive and to react to mouse activity. For this we’ll add some more code to the CSS (style sheet):

      Added stuff is self explanatory, padding is used to increase the clickable are of the menu items. Now the Menu Bar would look like:

      NOTE: Hover effect is not working here, because Icannot add stylesheet for seperate pages in Blogger and I don't want to mess up the CSS Validity of this page.

      Below is the complete code listing:

         >   >    >Menu Bar Using CSS>    >   .menu ul   {     list-style: none;   }    .menu ul li   {     display: inline;   }    .menu ul li a   {     /*Increase Clickable Area*/     padding: 8px;     padding-left: 15px;     padding-right: 15px;      /*Remove the Underline for the Link*/     text-decoration: none;      color: #000;     background: #ccc;   }    /*On Mouse Over the Link*/   .menu ul li a:hover   {     color: #fff;     background: #000;   }   >    >    >    class="menu">      >        > href="#">Item 1>>       > href="#">Item 2>>       > href="#">Item 3>>       > href="#">Item 4>>      >   >   >   >  

Creating Tool-Tip Text for WebPages Using CSS Only

Creating Tool-Tip Text for WebPages Using CSS Only

[You might also be interseted in Deigning a Simple HTML Menu-Bar Using CSS]

All right, so today we are going to use CSS along with some HTML to create Tooltip text for WebPages without using JavaScript. Yeah, you heard it right using only CSS and of course HTML. Do I need to explain what a Tooltip is, BTW? Nah, you guys already know it. I do not think many sites use tooltips or anything of that sort on their websites but in case you do or you just want to learn, read on…

Well, the first thing that I want to tell is that the basic technique I’ll be using to create tooltips is not mine, I saw someone using it for a slightly different purpose, I changes it to suite mine. As I said earlier we’d be using CSS and HTML only, I guess HTML is easier so here it is:

href="#" class="tooltip">Hover Here>This is the Tool-Tip Text>>

As you can see there is nothing special, a plain simple link but wait what is that for? Good question! Well the text under the tag wouldn’t be visible unless you hover the mouse over the link. When you do so that’d become visible, neatly formatted to look just like a real Tooltip text. But how? You might ask. It has been classified (class="tooltip") to do so.

The heart of all this is the CSS:

   a.tooltip{     /* for postioning the tool-tip box relative to the link */     position:relative;      /* no underline needed */     text-decoration: none;   }    a.tooltip span{     /* tool-tip text will not be visible initially */     display: none;   }    a.tooltip:hover span{     /* make tool-tip text visible */     display:block;      /* for postioning */     position:absolute;     top:20px; left:20px;     padding: 5px;      /* width of the tool-tip box     if text is longer, it will be     made into two lines */     width:150px;      /* style the box to look like a tool-tip box */     border:1px solid #000;     background-color:#FFFFAA;     color:#000;   }  

Now to make it more clear, I’d break the whole code into smaller pieces and discuss what that does:

1.

a.tooltip { position:relative; }

This would make the tooltip (whenever) it appears to be positioned relatively to where the link is.

2.

a.tooltip span { display: none; }

It’d (as you might have guessed) make the tooltip text (or the tag) to be invisible.

3.

  a.tooltip:hover span {       display:block;      position:absolute;      top:20px;      left:20px;      padding: 5px;      width:150px;     border:1px solid #000;      background-color:#FFFFAA;      color:#000;    }

This defines what the tag would be when mouse is hovered over the link.

First it’d make the visible (thus the tooltip text) by using display: block;. Next it’d position and style the text to look like a “Real” tooltip.

Easy! Now it is…

Here is the complete code:

   >   >    >ToolTip Text Example>