Here are some hints that might help you, based on experience of what works and what doesn't.
Use one data module for each database you want to use, i.e. one data module each for IBDatabase_24 and IBDatabase_Aktien.
These data modules contain everything you need to connect to the database, including transactions and, if necessary, logging. Also the method suggested by @rvk to read the parameters for the database settings from an INI file. (
https://forum.lazarus.freepascal.org/index.php/topic,70586.msg550413.html#msg550413)
Both data modules will then look pretty much the same except for the name of the INI file. Optimizations can be considered later. (Here's a tip: avoid inheriting data modules)
I recommend that you do not open a database connection directly in Lazarus to view data live in Lazarus. This simply causes problems sooner or later.
I also recommend that you do not let Lazarus create the data modules automatically, but create them yourself in the code. Then you can control the exact time of their creation and thus also the time of the connection to the database. This prevents forms from being created in the application without an existing database connection.
Essentially, only the main form is created automatically in my applications, everything else is done in the code.
It also makes sense to create a database development against test databases and not to use the original data. The INI files are then very helpful when switching over