Recent

Author Topic: embedded Firebird app installation  (Read 1887 times)

ronhud

  • Jr. Member
  • **
  • Posts: 84
embedded Firebird app installation
« on: May 02, 2022, 11:59:25 am »
I have a Lazarus app with an embedded Firebird database developed on a pc with Firebird installed.  I installed the app on my laptop some time ago and it ran succesfully ther.   The laptop then acquired serious corruption and I did a full clean installation of Windows 10 pro and copied my app onto the laptop.   On starting it I get an error message :-

DMibConnection1:DoInternalConnect:
-unavailable database

The database(FDB)  is in a separate folder and the app reads an ini file to get the correct path.

I have copied into the app folder the followng:-
fbclient.dll
firebird.msg
ib_util.dll
icudt30.dll
icuin30.dll
icuuc30.dll
all from the development pc.

I tried to access the database from FlameRobin and received a message which included the following

SQLMessage -902    Unsuccesful execution caused by a System error that precludes successful execution of subsequent statements.
Engine Code: 335544721   Unable to complete network request to host "localhost"

Are the files I have copied over enough or have I missed something?   It all worked on the laptop before I had to do the full install and I cant recall what steps I took in putting the app on it initially.

I have looked at Firebird references to using the embedded server option and think I have done what it says.


Zvoni

  • Hero Member
  • *****
  • Posts: 2327
Re: embedded Firebird app installation
« Reply #1 on: May 02, 2022, 12:14:55 pm »
and reading this link: https://www.firebirdsql.org/pdfmanual/html/ufb-cs-embedded.html
the first sentence is
Quote
Embedded server on Windows

The Windows Embedded Server is a Superserver engine plus client rolled into one library, called fbembed.dll.
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: embedded Firebird app installation
« Reply #2 on: May 02, 2022, 12:20:45 pm »
Besides the dll you mentioned you also need the intl and udf directories.

The link Zvoni gave has a description of everything you need.

And if you use FlameRobin in embedded state you also need to copy all those things to the directory where flamerobin.exe is. And don't use it the same time as your own application.

« Last Edit: May 02, 2022, 12:22:39 pm by rvk »

korba812

  • Sr. Member
  • ****
  • Posts: 394
Re: embedded Firebird app installation
« Reply #3 on: May 02, 2022, 12:20:59 pm »
What version of Firebird are you using? If version 3 or higher then you must have the "plugins" directory along with the file "engine12.dll" (FB 3) or "engine13.dll" (FB 4).

http://www.ibphoenix.com/files/Embedded_fb3.pdf
« Last Edit: May 02, 2022, 12:23:39 pm by korba812 »

ronhud

  • Jr. Member
  • **
  • Posts: 84
Re: embedded Firebird app installation
« Reply #4 on: May 02, 2022, 12:24:00 pm »
Thanks I read that fbembed.dll should have its name changed to fbclient.dll - anyway I I have just tried changing it's name but same error.  Also FlameRobin fails.
The instruction to rename is further down in the document you refer to.

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: embedded Firebird app installation
« Reply #5 on: May 02, 2022, 12:40:14 pm »
What is the connectionstring?
You mentioned localhost in flamerobin but with the embedded firebird you shouldn't use localhost: notation.

ronhud

  • Jr. Member
  • **
  • Posts: 84
Re: embedded Firebird app installation
« Reply #6 on: May 02, 2022, 12:56:18 pm »
Thanks to everyone.   As the app is something for my own use only I took the route of installing Firebird  on the laptop and everything seems to work ok - crude but quick.

tonyw

  • Sr. Member
  • ****
  • Posts: 321
    • MWA Software
Re: embedded Firebird app installation
« Reply #7 on: May 04, 2022, 03:07:45 pm »
The point that seems to be missing from the above is that on Wndows you need a registry entry pointing to the Firebird directory. The FB installer creates one for you, if you install manually then either you have to create one yourself or your app needs to have its own conventions as to how it finds the DLLs. Sometimes setting the FIREBIRD environment variable does the trick. Other times placing the DLLs on the system PATH works.

See section 13.1 in my Firebird Pascal API Guide for deployment guidelines - https://mwasoftware.co.uk/downloads/send/5-ibx-current/146-firebirdpascalapiguide. Section 3.3 of the same doc describes how IBX/fbintf locates the Firebird DLL.

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: embedded Firebird app installation
« Reply #8 on: May 04, 2022, 09:34:51 pm »
The point that seems to be missing from the above is that on Wndows you need a registry entry pointing to the Firebird directory. The FB installer creates one for you, if you install manually then either you have to create one yourself or your app needs to have its own conventions as to how it finds the DLLs. Sometimes setting the FIREBIRD environment variable does the trick. Other times placing the DLLs on the system PATH works.
ronhud was talking about the embedded version. With that one the DLL's need to be placed in the .exe directory. You wouldn't want to spread those files around the whole system or create registry entries (otherwise the whole embedding isn't really useful. imagine multiple installations with different embedded version which all create their own registry entries. YIKES).

But for Firebird SQL < 3.0 the intl and udf directories are also needed and you need to make sure you have the correct fbclient.dll (renamed from fbembed.dll). You can put some of these in a subdirectory but you need to fiddle with firebird.conf in that case. You ALSO need to make sure the bitness (32bit/64bit) of fbclient.dll matches the one of your .exe program (a very common mistake to make). So there are some extra things you need to take care of. And Firebird SQL 3.0+ works a bit different too. And lastly, you should use the correct connectionstring (no localhost or hostname in the string).


 

TinyPortal © 2005-2018