How do I migrate this kind of HSQLDB file to Firebird?

counter_WinSettings.odb (49.2 KB)
From Ratslinger & Villeroy
.
This file works perfectly with the built-in HSQLDB.
The macros save and retrieve screen coordinates without any issues.
.
Why do these macros generate errors in Firebird’s external database/Base? I’d like to understand why; it’s as if Base is closing the connections before Firebird can process the data.
.
This makes me hesitant to use Firebird as my SQL engine because the compatibility doesn’t seem seamless.

Seems there is no content inside the macro code, which would only work with a specific database.
Which kind of error do you get with an external firebird file?

What’s wrong with HSQL?

  • It’s embedded.
  • The embedded version is very old, lacking many useful features.

Nevertheless, it is the preferred database backend for LibreOffice Base. 20 years ago, Base was built around HSQL.
Free your embedded HSQL from the Base container:
https://forum.openoffice.org/en/forum/viewtopic.php?f=21&t=86071

  • Extract HSQL, upgrade to HSQL 2.4.1, then recent version 2.7.4.
  • Run it in server mode on any platform.
  • Add roles and users.

[quote=“RobertG, post:2, topic:130815, full:true”]
Seems there is no content inside the macro code.

You’re absolutely right. I inserted the missing code and it finally works perfectly.

So I’m going to try migrating to Firebird, which, according to discussions on this site, seems to be more stable and less risky in terms of data loss.

I also read that Firebird can be embedded rather than external, but I’ve never seen that option in the SQL database selection.

When creating the database, it asks whether you want it to be referenced or not. Which of the two options is preferable?

I’ll take a look at that, but I’ll need some time to understand what’s going on. My intellect isn’t as sharp as it used to be…

:grey_question:
FirebirdEmbedded

image

Abstain from embedded databases! An external Firebird database consists of a single .fdb file besides the connected .odb document.

I think you must enable “Experimental” in the same window one adds Java…
And, of course you should do not for “production”!

You’re right. The integrated Firebird is available with ‘Experimental’ selected.

However, I think I’ll follow Villeroy’s advice to avoid all embedded databases. He’s always given good advice.

Of course.
Embedded is practical for testings and sharing while doing this. Never for real (“production”) usage.

  1. The downloadable Writer document shows some Python code which can be installed with a single click.
  2. Then you find some macros under “My Macros”>pyDBA>Extract HSQL.
  3. Open your document with embedded HSQL and run the Main routine.
    Now you have your database document connected to a stand-alone HSQLDB in subfolder “database”. It is still the same old version 1.8. but it is not as prone to data corruption as it used to be in the embedded state.
  4. Test the document. If everything works, save the document.
    Now you may upgrade from 1.8 to 2.4.1 of 2020, which was the last version able to convert the old version:
  5. Create a blank folder named “driver” besides the “database” folder.
  6. Download Download hsqldb-2.4.1.zip (HyperSQL Database Engine (HSQLDB)) and extract the file lib/hsqldb.jar into the “driver” directory.
  7. Repeat steps 3 and 4. Now you have upgraded your stand-alone database to version 2.4.1.
  8. Repeat step 6 and 7 with the latest HSQL download, replacing the hsqldb.jar in the “driver” folder. Now you have your Base document connected to a stand-alone HSQLDB of the latest version. It co-operates flawlessly with your Base document (as far as I experienced until now).

Your Base document still embeds the old HSQLDB sleeping. You can reactivate it by calling macro “Revert_To_Embedded”.
There is also a macro “Remove_Embedded” to delete the old database.