Ask Your Question
0

Cannot connect to firebird database, win10

asked 2019-06-02 20:06:32 +0200

pisoiu gravatar image

updated 2019-06-02 21:50:37 +0200

Ratslinger gravatar image

Hi all, I looked over every post I found regarding this matter but I was unable to make things work, so I must ask:

Bigger picture: On my laptop (win10) I installed libre office an earlier version and last few days I upgraded to 6.2.4.2 (last one at this moment). With libre base I created a database which keeps inventory of electronic components in my company. Nothing too fancy, max. 10 tables, one table is bigger, with components codes, various other information and some pictures. All is kept in embedded firebird, one .odb file, approx. 5mbytes size. I have one form in base which helps me populate database and which helps me with searches. But it is not enough, there are many operations I must perform and which must be done in a separate application I have to write. Only IDE I can use is visual studio community and this one knows to connect to firebird database, but not embedded type. Only with .fdb files. For that purpose, I installed visual studio community 2015 with appropiate modifications to be able to connect with firebird databases and also installed firebird 2.5.8 for x64. I created an empty database ( .fdb file) and I succesfully connected it with visual studio.

But until the app is done, I have to populate .fdb database and I thought I can do this with libre base. But I was wrong. Here are the steps I did:

  • open base, in wizard, connect to an existing database, (from combo) select firebird file

  • next, browse to .fdb file

  • next, yes, register the database in libreoffice, after database file saved, open for editing

  • finish, save a .odb file

  • following error occurs:

the connection to the datasource could not be established firebird_sdbc error: *Unable to complete network requests to host 'Flo' *Failed to locate host machine *The specified name was not found in the hosts file or Domanin Name Services caused by: 'isc_attach_database'

What I did (but without results) following various advice from posts:

  • at options/advanced I have 2 jre installed, 1.8.0_211 and 12.0.1, 'enable experimental features' checked

  • jdbc drivers are downloaded and their paths is defined in 'class path'

  • hosts file contains 'Flo' 127.0.0.1,

So, how can I make it work. What have I done wrong?

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-06-02 20:24:55 +0200

Ratslinger gravatar image

updated 2019-06-02 22:46:54 +0200

Hello,

Installing Firebird 2.5.8 was not needed. You can create a .fdb file directly in base.

Start Base wizard. Select Connect to an existing database. Use dropdown & select Firebird File. Select Next and then Create New.

That should produce the needed file. You can copy/paste from original embedded file to this one all tables, forms etc.

Edit:

At this point, based upon your comment, file is not needed. You should most likely stick to just the server since this is needed for Visual Studio.

With my system (Linux Mint but should be OK for Windows) I am using Firebird 3 server and Jaybird 3.X JDBC connector (found here -> Jaybird 3.0).

Class Path is set to use jaybird-full-3.0.5.jar.

For Base connection, JDBC driver class:

org.firebirdsql.jdbc.FBDriver

and Datasource JDBC:

firebirdsql:oo://localhost//YOUR_DATABASE_DIRECTORY/DATABASE_NAME.fdb?charSet=UTF-8

With this both should work.

edit flag offensive delete link more

Comments

Thanks. I forgot to tell ,among many things I tried, I also tried what you suggested. Unfortunately I get the same error. Installing firebird is necessary for visual studio.

pisoiu gravatar imagepisoiu ( 2019-06-02 21:00:24 +0200 )edit

OK, one further problem is not knowing what you want to end up with - server access, file or embedded? I understand you need Visual Studio for now but what lies ahead? Have tried successfully many different scenarios in Linux in last year. Should work in Windows also but need to understand what your final goal is.

Ratslinger gravatar imageRatslinger ( 2019-06-02 21:45:58 +0200 )edit

My goal is to have all on one computer, database file and application which work with it. Linux is beyond me, I am an embedded programmer for 8051 and all I do well is 8 bit asm. I also used visual studio, more precisely visual basic, and I need to write all myself. That is partly because it is not economically feasible for me to pay somebody for it and partly because it is a continuously developing job. It is not complicated, a database with few hundreds components in which quantities must be updated with new purchasing orders, production batches, data inputs comes from barcode reader, keyboard and csv files. Barcode reader and csv files are the main problems which forces me to move from libreoffice forms to application.

pisoiu gravatar imagepisoiu ( 2019-06-02 22:19:15 +0200 )edit

Ok, some news: I am still trying various things, but I found something. When 'connect to an existing database', 'firebird file', 'create new', after 'save', the autogenerated url looks like 'file:///C:/.....'. That is wrong, one '/' must be deleted. After that, on libreoffice 6.1.6 I got an 'ok' at 'test connection'. But I created a new table to test, 2 columns (one autogenerated primary key and one text), put 4 records of data, save all, quit. At next opening, table was there, but empty. No data inside. Also, if I am trying 'tools', 'user administration', libreoffice crashes. With libreoffice 6.2.4, same procedure gives another error, like sdbc driver missing.

pisoiu gravatar imagepisoiu ( 2019-06-02 22:34:07 +0200 )edit

Please see edit in answer.

Also note, latest versions of LO are set to use Firebird 3. SDBC connector is possibly complaining about Firebird 2.5.x file.

Ratslinger gravatar imageRatslinger ( 2019-06-02 22:47:22 +0200 )edit

Indeed it works. Thank you very much for your help. To be honest I did not understood exactly what I did, it is beyond my knowledge, but it works. I am stuck with 2.5, it is the only one which can be used with visualstudio. The procedure to setup vs with firebird is a mess....

pisoiu gravatar imagepisoiu ( 2019-06-02 23:08:21 +0200 )edit

@pisoiu Just a note, setting up LO Base with Firebird is no different than with any other database server and a JDBC connector. Using an ODBC connector can be more complicated depending upon the OS being used.

Ratslinger gravatar imageRatslinger ( 2019-06-03 01:14:26 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-06-02 20:06:32 +0200

Seen: 36 times

Last updated: Jun 02