Recent

Author Topic: Firebird - Connecting using an IP address  (Read 541 times)

guest64555

  • Guest
Firebird - Connecting using an IP address
« on: September 03, 2019, 08:30:54 am »
Hello everyone,,
I am re-writing a program of mine which used DBF and now trying to use firebird. My first problem I am having is when I try and point the databasename location to the following path using an UNC:
\\10.1.1.1\database\data.fdb

I get an error when trying to set connect to true which is:

fblinks DoInternalConnect:
 - Unable to complete network request to host "10.1.1.1"
 - Failed to establish a connection

Does Firebird not accept IP UNC paths ? I know if I point via the drive instead it does not error

Thanks.
« Last Edit: September 06, 2019, 10:41:57 am by marcov »

devEric69

  • Full Member
  • ***
  • Posts: 154
Re: Firebird - Connecting using an IP address
« Reply #1 on: September 03, 2019, 10:23:26 am »
Which controls do you use: IBX?
use: Ubuntu 18.04 + Laz. 1.8.5 + FPC 3.0.5 (64 bits).

rvk

  • Hero Member
  • *****
  • Posts: 3842
Re: Firebird - Connecting using an IP address
« Reply #2 on: September 03, 2019, 10:59:24 am »
Does Firebird not accept IP UNC paths ?
No, Firebird doesn't accept UNC paths for database names.

You need to specify a IP or hostname and a LOCAL path on the server to the database.

So:
10.1.1.1:C:\LocalServerPath\data.fdb

If there is a separate field for hostname you need to set the 10.1.1.1 in that field and just use C:\LocalServerPath\data.fdb for the databasename.

tonyw

  • Full Member
  • ***
  • Posts: 150
    • MWA Software
Re: Firebird - Connecting using an IP address
« Reply #3 on: September 03, 2019, 03:01:55 pm »
You will find this all documented in the Fireburd 3 Release notes in the section "Connection String and Protocols".
If you are using an IP Address, I would recommend using the URL style syntax:

inet://192.168.0.11/C:\db\mydb.fdb (windows)

inet://192.168.0.11//db/mydb.fdb (unix derivatives)

IBX transparently handles the connect string and will accept all formats for the DatabaseName. I assume that other database connectors do the same.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 831
Re: Firebird - Connecting using an IP address
« Reply #4 on: September 03, 2019, 03:06:09 pm »
Hello everyone,,
I am re-writing a program of mine which used DBF and now trying to use firebird.
You'll be more productive if you reserve some time to study Firebird:
http://firebirdsql.org/en/firebird-rdbms/
https://www.youtube.com/results?search_query=firebirdsql

Quote
My first problem I am having is when I try and point the databasename location to the following path using an UNC:
\\10.1.1.1\database\data.fdb
I get an error when trying to set connect to true which is:
fblinks DoInternalConnect:
 - Unable to complete network request to host "10.1.1.1"
 - Failed to establish a connection
Does Firebird not accept IP UNC paths ? I know if I point via the drive instead it does not error
Thanks.
No.

You need to specify a IP or hostname and a LOCAL path on the server to the database.
...
10.1.1.1:C:\LocalServerPath\data.fdb
+1

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Firebird - Connecting using an IP address
« Reply #5 on: September 03, 2019, 03:58:21 pm »
« Last Edit: September 03, 2019, 05:20:23 pm by Paul Breneman »
Regards,
Paul Breneman
www.ControlPascal.com

Mathias Burbach

  • Newbie
  • Posts: 2
Re: Firebird - Connecting using an IP address
« Reply #6 on: September 09, 2019, 06:52:58 pm »
Hello guest64555,

you can use an alias to specify the Firebird DB on a particular server. In Firebird 2.X the alias names are specified in the file alias.conf under the Firebird folder. In Firebird 3.X the file is named databases.conf. The following entry exists for Firebird 3.0.4:
employee = $(dir_sampleDb)/employee.fdb

So then the connection string con just be localhost:Employee

Here is an exerpt of my lfm file:
Code: Pascal  [Select]
  1. object SQLConnector1: TSQLConnector
  2.   Connected = False
  3.   LoginPrompt = False
  4.   DatabaseName = 'Employee'
  5.   KeepConnection = False
  6.   Password = 'YourPassword'
  7.   UserName = 'YourUserName'
  8.   HostName = 'localhost'
  9.   ConnectorType = 'Firebird'
  10.   left = 44
  11.   top = 62
  12. end

Salut,
  Mathias