Search code examples
c++sqlfirebirdfirebird2.5

Firebird remote connection failure


I have a C++ application that used to read the data from the Firebird SQL server.

when I changed port from 3050 to 3053 it shows error like

DB Error : 0 : Unable to complete network request to host "192.168.1.47".
Failed to establish a connection.
unknown Win32 error 10060
Invalid connection string attribute

conf file is changed like

# Type: string, integer
#
RemoteServiceName = gds_db
RemoteServicePort = 3053

Fb connection string is

Driver=Firebird/InterBase(r) driver;DBNAME=192.168.1.47:CWNPFB;PORT=3053;UID=SYSDBA;PWD=********

Is there any modification is required to solve this? Application can read the data if the port is 3050.


Solution

  • The problem is with your connection string:

    You need to

    1. Remove PORT=3053 from the connection string (this causes the "Invalid connection string attribute" message)
    2. Modify DBNAME=192.168.1.47:CWNPFB to DBNAME=192.168.1.47/3053:CWNPFB (to specify the right port)

    You might also want to comment out (or remove) the line RemoteServiceName = gds_db, because you are now instructing Firebird to listen on gds_db (== port 3050), and not on port 3053. I believe it usually listens on the last one configured in the config file, but I'm not sure that is always the case.