IBX - example for dummies lazarus / 16-Databases ---------------------------------------------------------------------- Nicole · 2022-08-23 14:11 The  component IBX comes with examples. Some of them I am not able to run, most I could not. Why? - The database employee is missing. This database is around, e.g. is it included in firebird or I find it on my HD. Unfortunately I do not know, how and where I shall put it, that it makes the IBX demos run with it. Not sure, what and how I have done it, but IBX gave me that information some days ago and I quickly copied it, before I lose it again, may be it helps: Firebird Library PathName = C:\Firebird_2_5\bin\fbclient.dll Server Version = WI-V2.5.4.26856 Firebird 2.5 Server Implementation = Firebird/x86-64/Windows NT Service Version = 2 Firebird Release = 2.5.4 (Build no. 26856) No. of attachments = 0 No. of databases = 0 Base Location = C:\Firebird_2_5\ Lock File Location = C:\ProgramData\firebird\ Security Database Location = C:\Firebird_2_5\security2.fdb Message File Location = C:\Firebird_2_5\ ---------------------------------------------------------------------- tonyw · 2022-08-23 15:12 First point: why are you using a old version of Firebird? Support was discontinued in 2019. Last version was 2.5.9. The employee database should be located in examples\empbuild\EMPLOYEE.FDB I am not sure if Firebird 2.5 automatically created an alias entry for the examples database, so you may have to give the path explicitly ( C:\Firebird_2_5\examples\empbuild\EMPLOYEE.FDB) when opening it. Better still, why not upgrade to Firebird 3 or Firebird 4. ---------------------------------------------------------------------- Nicole · 2022-08-23 16:52 Version 4 is downloaded since long, -  and I did not install, because I feared the problems every upgrade brings. Nobody knows, how my existing software will react to such an upgrade. But you are right, I will upgrade. It is a VM and if it fails I will revert to a snapshot. Perhaps the demos will work then, if not, I will post again. ---------------------------------------------------------------------- rvk · 2022-08-23 17:05 Note that you will need to upgrade existing databases too in that case. Before uninstalling 2.5 do a backup with gbak. After install of 4.0 do a restore with gbak. 4.x and 3.x won't work with older databases and 2.5 won't work with newer databases. (That's why I advised in the beginning to first stay with 2.5 because you still had existing DBs and an existing program which needed access to that DB.) ---------------------------------------------------------------------- Nicole · 2022-08-23 17:35 Thank you for letting me know. Then I will not upgrade. It will take months until my Lazarus software can replace the old code. Until then I have to use the existing database every day. Once a year I do a rewrite by FlameRobin (which uses gbak). The database itsself is from 2013. ---------------------------------------------------------------------- zoltanleo · 2022-08-23 19:04 Hi Nicole As far as I remember, the ibx4laz components don't allow you to specify an arbitrary location for the fbclient.dll library. For Windows, they look for the library in the system folder '%SystemRoot%\system32(SysWOW64)'. You can ask the reason for this behavior from tonyw ( ). In your case, you need to copy your FB2.5 library fbclient.dll in the above folder and restart the server. After that, the components should work correctly. ---------------------------------------------------------------------- tonyw · 2022-08-23 21:54 Quote from: zoltanleo on August 23, 2022, 09:04:06 pmHi Nicole As far as I remember, the ibx4laz components don't allow you to specify an arbitrary location for the fbclient.dll library. With IBX, you can specify an arbitrary location for the Firebird Client Library. See the TIBDatabase.FirebirdLibraryPathName property. Quote from: zoltanleo on August 23, 2022, 09:04:06 pmFor Windows, they look for the library in the system folder '%SystemRoot%\system32(SysWOW64)'. You can ask the reason for this behavior from tonyw ( ). Err No. This is not how it works. The full algorithm is described in section 3.2 of the Firebird Pascal API User Guide. It's based on algorithm for loading the Firebird Client Lib from Delphi that I published many years ago, and in summary, IBX checks the following locations in order: 1. The directory holding the application executeable. 2. The location pointed to by the FIREBIRD environment variable, if any. 3. The Windows Registry entry locating the Firebird installation. 4. The default installation folders for Firebird 4, 3 ,2.5 and 2.1 and in taht order. 5. The Windows search path 6 And finally "If the DLL is still not found, then in quiet desperation, fbintf will attempt to load the legacy InterBase gds32.dll again using the Windows Search Path." If IBX does look in windows\System32 then its only because its in the Windows Search Path In practice, case 1 above should be used for deployed applications, whilst case 3 is the preferred approach for a development system. Case 2 is a special case for unusual installations, while the remaining cases are really attempts to get something to work on a broken system. Quote from: zoltanleo on August 23, 2022, 09:04:06 pmIn your case, you need to copy your FB2.5 library fbclient.dll in the above folder and restart the server. After that, the components should work correctly. Bad idea. IBX won't usually use this and you will end up with a forgotten DLL that many upgrades later will come back and bite you. ---------------------------------------------------------------------- tonyw · 2022-08-23 22:03 Quote from: Nicole on August 23, 2022, 07:35:38 pmThank you for letting me know. Then I will not upgrade. It will take months until my Lazarus software can replace the old code. Until then I have to use the existing database every day. Once a year I do a rewrite by FlameRobin (which uses gbak). The database itsself is from 2013. rvk is certainly correct in that you need to use gbak to move a Firebird Database from one server version to the next. However, if you do have access to VMs then it makes it easy to experiment and to try out the IBX examples in a VM created for this purpose. Generally, I have never found an issue upgrading the database server. Of course, having said that, you may find a problem that I have not come across. However, VMs are great for testing these things out. The Firebird Client library is backwards compatible and both FB3 and FB4 provide the 2.5 API. You thus be able to do a drop in replacement of the client library without having to re-compile your existing programs. Caution: test this out in a discardable VM first and not your operational system! ---------------------------------------------------------------------- zoltanleo · 2022-08-24 16:26 Quote from: tonyw on August 23, 2022, 11:54:52 pmWith IBX, you can specify an arbitrary location for the Firebird Client Library. See the TIBDatabase.FirebirdLibraryPathName property.A-ha. So you've made some code changes while your component was out of my view. Thanks for the info. Now I have a reason to re-install and try to use your component again