[SOLVED] IBX 2.4.0 Error : Firebird Library not found in the path lazarus / 16-Databases ---------------------------------------------------------------------- incendio · 2022-10-28 01:59 Hi guys, I have a TIBDatabase Object. On Property Window I set FirebirdLibraryPath = fb3.dll. When Connected Property set to True, Login Prompt appeared and after supplied correct username & password, Connection OK. Connection also OK when tested via Database Editor by right clicked TIBDatabase object. Problem is, when tried to run app, got that error. This is the codes on TDatamodule to open database Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TDM.DataModuleCreate(Sender: TObject); begin    Dba.Close();    Dba.Open;end;  But, the strange thing is, if I renamed fb3.dll to fbclient.dll, app runs OK. Why? How to fix this? Thanks in advance. ---------------------------------------------------------------------- rvk · 2022-10-28 07:29 Quote from: incendio on October 28, 2022, 03:59:13 amOn Property Window I set FirebirdLibraryPath = fb3.dll. fb3.dll isn't really a path, is it  Why would you want to use a different filename? You would need some other dll's and files too. Put all those (including fbclient.dll) in the directory of your choosing and set FirebirdLibraryPath pointing to that directory. ---------------------------------------------------------------------- incendio · 2022-10-28 08:38 Fb3.dll is the same location with exe file. Even though I put complete path, it didn't work. Only if the file name change to fbclient.dll, it will work even without full path. ---------------------------------------------------------------------- rvk · 2022-10-28 09:33 Quote from: incendio on October 28, 2022, 10:38:29 amFb3.dll is the same location with exe file. Even though I put complete path, it didn't work. Only if the file name change to fbclient.dll, it will work even without full path. It's all in the name: FirebirdLibraryPath That's a path. Not a path and filename. And not just a filename. So you can't specify Fb3.dll. You just need to specify the location of fbclient.dll. Why would you want to rename that fbclient.dll anyway? ---------------------------------------------------------------------- incendio · 2022-10-28 11:04 Quote from: rvk on October 28, 2022, 11:33:28 amQuote from: incendio on October 28, 2022, 10:38:29 amIt's all in the name: FirebirdLibraryPath That's a path. Not a path and filename. And not just a filename. So you can't specify Fb3.dll. You just need to specify the location of fbclient.dll. Why would you want to rename that fbclient.dll anyway? Although the property looks like a path, I don't think it's just a path. I choosed library path via object inspector in the IDE by clicked a button located right on the input box, and the value is Path & File name. I want to rename it just to make sure that the app uses that library, not firebird library that installed in my computer. Plan to deploy the app to users that don't have firebird installed in their computer. Btw, the database is remote database located in server. There's another strange thing. The Fb3.dll used is a renamed fbclient.dll from Firebird 3.08, while on my computer, Firebird 3.10 installed. If I renamed fbclient.dll from Firebird 3.10 to Fb3.dll, and used it, app worked OK. Unfortunately I can't use Fb3.dll from Firebird 3.10 because there is another app that can only work OK with dll from Firebird 3.08. ---------------------------------------------------------------------- rvk · 2022-10-28 12:01 I must take back my earlier remarks (sorry  ). You can supply the complete path + dll filename in FirebirdLibraryPathName. QuoteFirebirdLibraryPathName This published property is normally left empty. If not empty then it should be set to the pathname for the Firebird Library (DLL or so). If empty, IBX searches well known locations for the library. The property is typically used when the library file is not in an expected location or to force the selection of a specific file when several versions are available. (see also 5.1.12)https://www.mwasoftware.co.uk/downloads/summary/5-ibx- current/147-ibx4lazarusguide 5.1.12: QuoteHowever, it is also possible to specify the relative or absolute pathname of the Firebird Library on a per database basis by setting the FirebirdLibraryPathName property to such a pathname. When this property is non-empty then, before the database is opened, IBX will attempt to load the specified DLL or shared object library and use the Firebird API exported by the library for the database connection and all derived objects (e.g. transactions, SQL queries, etc.). I just tested it and it works. So, are you setting the complete directory to the exe including the dll name? If so, how are you doing that? In the object inspector or in code? How did you check if the correct library was loaded??? Also note that from the IDE, when in design time, the default library is always taken and can't be overridden by QuoteNote: the FirebirdLibraryPathName property is ignored at design time. When active in the IDE, IBX always looks for the Firebird Library in the well known locations. However, you can still use the FBLIB environment variable to provide the path to the Firebird library in a non-standard location when using IBX in the IDE (see section 3.3.4.1 of the Firebird Pascal API Guide. Note that the AllowUseOfFBLIB global variable is, be default, set to true at design time. In that case you'll need to set the FBLIB environment variable. Edit: (Just checked again and you can set in in code. But you need to run the project outside the IDE.) Quote from: incendio on October 28, 2022, 01:04:46 pmUnfortunately I can't use Fb3.dll from Firebird 3.10 because there is another app that can only work OK with dll from Firebird 3.08. That's weird. I thought those changes weren't that great. ---------------------------------------------------------------------- incendio · 2022-10-28 14:03 Since the dll is in the same folder with the exe file, I just type fb3.dll in object inspector. When using fb3.dll from Firebird 3.10, the app runs OK, but if fb3.dll missing from app directory, it raised error library not found, this how I know for sure that the app loaded the correct library. I just need IBX can load fb3.dll from Firebird 3.08. ---------------------------------------------------------------------- rvk · 2022-10-28 19:31 Quote from: incendio on October 28, 2022, 04:03:29 pmI just need IBX can load fb3.dll from Firebird 3.08. Are you sure the 3.08 version matches the bitness of your program (32 bit or 64 bit)? ---------------------------------------------------------------------- incendio · 2022-10-29 01:40 Quote from: rvk on October 28, 2022, 09:31:09 pmAre you sure the 3.08 version matches the bitness of your program (32 bit or 64 bit)? I always use 64 bit dll. On Firebird 3.10 (64 bit), copied Fbclient.dll from firebird folder (I believe it is 64 bit) to app folder and renamed it to fb3.dll, app worked OK. But if I used fbclient.dll from folder WOW64, it got same error. Could it be it is bitnes problem? I use Lazarus 2.0.12 32 bit on Windows 10 64 bit, I though the exe file should be 32bit exe right? Or am I Wrong? How to compile to a 32 bit exe? Attached is the target from Project Option, If Target OS changed to win 32, got error : ERROR: RTL unit not found: system.ppu ERROR: RTL unit not found: objpas.ppu ERROR: RTL unit not found: sysutils.ppu ERROR: RTL unit not found: classes.ppu ERROR: RTL unit not found: avl_tree.ppu ERROR: RTL unit not found: zstream.ppu ---------------------------------------------------------------------- incendio · 2022-10-29 03:45 You were right. I mess up 32bit with 64 bit. Few days ago, Windows 10 crashed, so I have to restored from last backup, As I remebered, Lazarus 2.0.12 in this backup is 32 bit, seem I was wrong. Uninstall Lazarus 2.0.12, and installed again Lazarus 2.2.2, wiped all previous configuration, and now everything runs OK, included other app, now it can runs dll from Firebird 3.10. Thanks for your help, appreciated