1

I have a server with Firebird 2.5.3 and I need read then database on another server over the ODBC connection for use in SSIS project(integration services), so I shared the folder with the .FDB database and set the address in my ODBC connection, but doesn't works.

enter image description here

My file firebird.conf:

# ----------------------------
# TCP Protocol Settings
#
# The TCP Service name/Port number to be used for client database
# connections.
#
# It is only necessary to change one of the entries, not both.  The
# order of precendence is the 'RemoteServiceName' (if an entry is
# found in the 'services.' file) then the 'RemoteServicePort'.
#
# Type: string, integer
#
RemoteServiceName = fb_db
RemoteServicePort = 5050

I try: Without port: 192.168.100.21:C:\IntegracaoRH\CONSISANET2_5.FDB and With : 192.168.100.21:5050:C:\IntegracaoRH\CONSISANET2_5.FDB and same error.

How to make remote ODBC connection?

Arioch 'The
  • 15,799
  • 35
  • 62
user8223022
  • 195
  • 2
  • 15
  • Is your Firebird server Windows-based or POSIX-based? – digital.aaron Feb 12 '20 at 18:11
  • Is `Integracao` a folder name? It appears that you may have too many colons (`:`) in that string. – digital.aaron Feb 12 '20 at 18:15
  • My both server are Windows. Server **"A"** is the server with Firebird-Server installed, and Server **"B"** is the server that will read database from server **"A"**. The name of the folder is transformed when I choose the address via the Browse button. The original address is: `\\192.168.100.21\IntegracaoRH\CONSISANET2_5.FDB` – user8223022 Feb 12 '20 at 19:08
  • Hmm, I think you may be able to use `192.168.100.21:\IntegracaoRH\CONSISANET2_5.FDB`, but from what I've seen, for Windows servers, you also need the drive letter. So if the path to `\IntegracaoRH` is actually `d:\SomeFolder\IntegracaoRH`, then you would use `192.168.100.21:d:\SomeFolder\IntegracaoRH\CONSISANET2_5.FDB` – digital.aaron Feb 12 '20 at 19:14
  • I did your suggestion: `192.168.100.21:C:\IntegracaoRH\CONSISANET2_5.FDB` and same error. – user8223022 Feb 12 '20 at 19:25
  • @digital.aaron Interbase/Firebird have separate connection layers and engine layers. As a semi-documented consequences there is a daisy chaining. This connection string, very unusual and probably erratic, might read like *Connect to 192.168.100.21 server, and ask him to connect to IntegracaoRH server to the CONSISANET2_5.FDB database* - while probably it was not the INTENTION of human operator, that is what the screenshotted line should mean to Firebird – Arioch 'The Feb 13 '20 at 08:12
  • `The original address is: \\192.168.100.21\IntegracaoRH\CONSISANET2_5.FDB` - that can not be! Firebird does only work with local files! See https://stackoverflow.com/questions/35861765 and https://stackoverflow.com/questions/53192079 and others! – Arioch 'The Feb 13 '20 at 08:15
  • Connection strings are described at https://firebirdsql.org/manual/qsg10-connecting.html and for FB3 https://firebirdsql.org/file/documentation/reference_manuals/user_manuals/html/qsg3-databases.html – Arioch 'The Feb 13 '20 at 08:21
  • *192.168.100.21:C:\IntegracaoRH\CONSISANET2_5.FDB and same error* means that the current computer failed to connect to Firebird server running on 192.168.100.21 computer using TCPv4 connection and default port. I saw rare cases when aftersome Windows update the Firebird client library thought default port is zero and failed all TCPv4 connections, and i think modern FB has protectio nagainst this. So either FB server is not running on 192.168.100.21, or is running on non-standard port, or firewall on one or both computers prevents the connection. Use tools like MS NetMon or WireShark to check – Arioch 'The Feb 13 '20 at 08:25
  • The error means that Firebird isn't listening on 192.168.100.21 port 3050. Do you actually have a Firebird server running on 192.168.100.21? Also, please update your question with the actual connection string you are using right now, because the one in the screenshot is definitely incorrect. – Mark Rotteveel Feb 13 '20 at 10:16
  • 1
    @Arioch'The redirection is disabled by default though. – Mark Rotteveel Feb 13 '20 at 10:19
  • 1
    I updated the question with firebird.conf and the paths used, but I still can't connect. And yes, on server 192.168.100.21 the Firebird service is working. – user8223022 Feb 13 '20 at 14:29
  • Funny, there is description of ConnStr format for FB3, because it changed from what was there since Interbase in 1990-s. But there is no full description of ConnStr for FB2, officiall. Getting Started is incomplete. Firebird.conf does not even mention it. There is unofficial info at http://www.firebirdfaq.org/faq259/ though blessed at https://firebirdsql.org/en/faq/ – Arioch 'The Feb 13 '20 at 14:56
  • In Firebird Connection String format for TCPv4 netywork protocol, the port number is separated from the server name **by slash**, not by colon. Colon separates "server/port" half from "database alias or filename" half. Slash separates: either servername from port when before colon, or one folder from another from filename when after colon. – Arioch 'The Feb 13 '20 at 14:58
  • @Arioch'The Using `\\192.168.100.21\IntegracaoRH\CONSISANET2_5.FDB` might work on Windows, it uses the WNET protocol. But, with a relative path. But I guess that the OP navigated to the UNC path `\\192.168.100.21\IntegracaoRH\CONSISANET2_5.FDB` (which is not the same as the Firebird WNET URL with the same value). – Mark Rotteveel Feb 13 '20 at 16:29
  • @MarkRotteveel "it uses WNET protocol" but it is not "using file from shared folder", forgetting this important disctinction did make a lot of confusion in the prior questions. In particular and in this question, knowing this simple fact would prevent topic starter from "navigating to UNC path" via Browse button. He would instantly know he is off the right track. Granted, FB project is way too reliant on Interbase docs. "Old guards" do not need independent docs that much, afterall. – Arioch 'The Feb 13 '20 at 17:44

1 Answers1

1

According to the configuration you posted, your Firebird instance is running on port 5050, however when you don't specify a port in the connection string, then the Firebird client will default to port 3050.

To use the right port, you need to explicitly specify the port in your connection string, by using format <host>/<port>:<db-path-or-alias>.

In other words, something like:

192.168.100.21/5050:database-alias

Where database-alias should be the alias or the path of your database.

Be aware, Firebird on Windows supports URLs of the form \\<host>\<db-path-or-alias> using the WNET protocol. However my guess would be that you navigated to the UNC-path \\192.168.100.21\IntegracaoRH\CONSISANET2_5.FDB. There is no 1-on-1 correspondence between an UNC-path and a Firebird WNET-url: they look the same, but they are not the same thing. The 'Browse' button in the ODBC configuration should only be used to select databases local to your machine.

As an aside, being able to browse to an UNC-path \\192.168.100.21\IntegracaoRH\CONSISANET2_5.FDB suggests that your database is in a folder shared to the network. You shouldn't share databases over the network through a fileshare. It is insecure, as anybody with access can create a copy of the database and access it with full permissions, or even replace or otherwise damage the database. Access to the database should always be done through a Firebird server on the same host as the database file.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • I did a test with telnet and for that port it was blocked, then I changed the way to pass the path in ODBC: `192.168.100.21:5050:C:\IntegracaoRH\CONSISANET2_5.FDB` to `192.168.100.21/5050: C:\IntegracaoRH\CONSISANET2_5.FDB` and it worked. thank you – user8223022 Feb 13 '20 at 17:08