Search code examples
windows-8firebird

How to solve a connection refused to localhost error SQLCODE -902?


Everyday for the past two weeks I've been successfully connecting to my Firebird database (2.0.1) with the isql prompt using the following connection string:

SQL> CONNECT "localhost:C:\Users\casa\Desktop\DB-Helper\PDVDATA.FDB" user 'SYSDB
A' password 'masterkey';

Today I couldn't. Instead I'm getting this error:

Statement failed, SQLCODE = -902
Unable to complete network request to host "localhost".
-Failed to establish a connection.
-No se puede establecer una conexi¾n ya que el equipo de destino deneg¾ expresam
ente dicha conexi¾n.

The last line can be translate to: can't establish a connection because the end machine expressly rejected such connection (sorry I did my best here :S)

The only thing I can think is different today, is that yesterday, when turning off the computer I was prompted to update (I'm using Windows 8). Besides that I'm not doing nor did I install anything new.

I tried fixing the issue with: opened windows firewall advanced security and created both inbound and outbound rule > for a port > TCP 3050 > allow connection > Domain, private and public > name: gds_db no description

I've also run in a command prompt

telnet localhost 3050

and the response was:

Conectándose a localhost...No se puede abrir la conexión al host, en puerto 3050
: Error en la conexión

Which can translate to: Connecting to localhost... Can't open the connection to host on port 3050: error in the connection

To be fair I've also tried the same thing (telnet localhost 3050) on a different PC, with a different OS (Ubuntu) with a different ISP and got the same response.

Any ideas?


Solution

  • @Mark Rotteveel was right!

    It sounds like your Firebird server is not running. –  Mark Rotteveel

    I run

    C:\Program Files (x86)\Firebird\Firebird_2_0\bin>instsvc start
    

    and that started the service. After that the connection was made like usual. Idiot me I choose the 'start the service manually' during the installation. I wasn't lying though for the past two weeks I did started the connection in the isql without starting the service manually. I forgot I choose that configuration. It was driving me insane! Thanks a lot Mark :)