(Solved) Cannot open Form - "Document frm_xxx could not be opened" Error Message Box

19 replies [Last post]
Walkinshaw
Offline
Last seen: 5 weeks 3 days ago
Title: ★★★
Joined: 3 Sep 2012
Posts: 34
I have been developing my database happily for some months now but suddenly get the Subject error message. I was editing the associated table which went fine and then went back to my Form and got the error. The Table also seems to be now corrupted – shows a much earlier version I am using the internal database -I know, I am supposed to use a split database but with all the confusion re firebird etc. I have been waiting. It’s not a disaster – I have a back up from a couple of days ago – but hope to learn what happened.I have tried search without success so can any of the Base experts offer suggestions so that I might save the last few entries? Thanks
LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on 4GB ASUS M32 i3 Desktop and LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on Core Duo 2GHz Toshiba Satellite L355 Laptop
frofa
frofa's picture
Offline
Last seen: 13 hours 24 min ago
Title: ★★★★★
Joined: 24 Feb 2012
Posts: 804
Trying to rescue a corrupt Base file
It may not be easy or even possible, but HSQLDB experts might be able to help you rebuild your .script or .data file (which are ‘inside’ the .odb file which is really just a re-designated .zip ‘container’ file.) Perhaps post on the HSQLDB forum HERE.

See THIS THREAD for some tips – especially DACM’s comments at the end – i.e. you might trying ‘splitting’ your ‘embedded’ files to see if you can get the tables to show up. You might use the information provided in DACM’s tutorial. If this procedure works, at least would would have a much more stable ‘split’ database at the end.

Also see here for some rather technical discussion about one user’s efforts to rescue a file. Luckily you have backups.

Walkinshaw
Offline
Last seen: 5 weeks 3 days ago
Title: ★★★
Joined: 3 Sep 2012
Posts: 34
Splitting Database from Embedded Database with Many Images
Thank you frofa for your analysis of my situation – much food for thought in those links. 1. My (embedded) database has over 10,000 images (stored externally of course). How are these handled in the migration to a split database? 2. Should I be concerned about doing this split and then find out that Base has moved to Firebird?
LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on 4GB ASUS M32 i3 Desktop and LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on Core Duo 2GHz Toshiba Satellite L355 Laptop
frofa
frofa's picture
Offline
Last seen: 13 hours 24 min ago
Title: ★★★★★
Joined: 24 Feb 2012
Posts: 804
Splitting Database from Embedded Database with many images
Walkinshaw:

1. My (embedded) database has over 10,000 images (stored externally of course). How are these handled in the migration to a split database?

I presume your database has a column that stores relative file-path information to locate your images. After you ‘split your database, you will end up with a folder containing your .data. script .properties etc files (i.e. your split DB ‘suite’ of files) and probably also your NEW .odb file (which contains all your report, queries, forms but NOT your tables.) This .obt file can actually go anywhere, but I usually recommend keeping it together in the same folder as the rest of the ‘suite’. So as long as you maintain the location of your image folder relative to your .odb file, everything should work as before. (Most probably you would keep your image folder inside your ‘suite’ folder and because it contains everything it’s ‘portable’ and to backup your data you can just copy/duplicate your entire ‘suite’ folder.)

2. Should I be concerned about doing this split and then find out that Base has moved to Firebird?

Well, I imagine there will be a well-defined set of steps needed to translate existing ‘embedded’ or ‘split’ HSQLDB-based DBs over to Firebird. Maybe the devs will build in some kind of automated process to do this. I don’t know what the plans are really, but in my opinion I would just proceed to split your DB so you have a more stable, less corruption-prone system (and you also might be able to retrieve your ‘lost’ records in the process.)

Make sure you keep working BACKUPS of your original embedded database thoughout!

Walkinshaw
Offline
Last seen: 5 weeks 3 days ago
Title: ★★★
Joined: 3 Sep 2012
Posts: 34
Not Quite ThereYet with Making a Split Database
Well, I tried to follow DACM’s well written tutorial but I am not quite there yet. Almost though; I get the JDBC hsqldb line at the bottom of my mydb_wizard.odb When I open my form it gives me a “cannot find table” message and sure enough there are no tables in the Tables icon. The tutorial does not say anything specific about the hsqldb.jar file; I just extracted it into the split database folder so it just reads hsqldb. (I am trying this on my Linux laptop) Any pointers would be much appreciated. (No worries about the previous corrupted embedded file. It was only a few dozen entries which have been easily redone – and saved)
LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on 4GB ASUS M32 i3 Desktop and LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on Core Duo 2GHz Toshiba Satellite L355 Laptop
Walkinshaw
Offline
Last seen: 5 weeks 3 days ago
Title: ★★★
Joined: 3 Sep 2012
Posts: 34
Opening Split Database shows a new database Message
I tried it all again and here is an update which may help. When I get to the point of opening mydb_wizard.odb, I do get a window saying new database as per the warning in DACM’s tutorial under Option 1, Point 2. This suggests something was missed before this stage and I have reviewed it several times now but cannot spot it.
LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on 4GB ASUS M32 i3 Desktop and LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on Core Duo 2GHz Toshiba Satellite L355 Laptop
dacm
Offline
Last seen: 6 weeks 5 days ago
Title: ★★★★
Joined: 26 Jan 2011
Posts: 84
Don't extract hsqldb.jar
Reference: Tutorial – Splitting an embedded HSQL database

hsqldb.jar is distinct from your HSQL database files. hsqldb.jar is the database-engine, available as single file-download from the provided link. Your operating system (OS) may identify the file as a zip archive. That’s because a jar file is a zip-archive. But do not extract this file. Simply place it in your split database folder.

On the other hand, your HSQL database files must be extracted from your legacy .odb file into the split database folder. These files must be renamed with a common prefix such as mydb.script, mydb.data, mydb.properties, and if present mydb.backup.

If you’ve followed steps A thru E of the tutorial, then you should get a prompt to allow macros upon opening mydb_wizard.odb in Base. If you can otherwise open and access tables in an embedded HSQL database (thereby indicating proper Java JRE support), then any error upon opening mydb_wizard.odb located within your split database folder indicates a missed step.

dacm
Offline
Last seen: 6 weeks 5 days ago
Title: ★★★★
Joined: 26 Jan 2011
Posts: 84
New database...
If the wizard offers to create a ‘new’ database, then your HSQL database files are not present or properly named in your split database folder. Again, mydb_wizard.odb, hslqdb.jar, mydb.script, mydb.data, mydb.properties, and if present mydb.backup all must be located in the same folder with mydb_wizard.odb and hsqldb.jar (not a separate ‘database’ subfolder of your split database folder).

You can use any consistent prefix such as db.script, db.data, db.properties, and if present db.backup. And you can rename mydb_wizard.odb while maintaining the .odb extension such as my_database.odb. You can also rename or move the folder as desired.

Walkinshaw
Offline
Last seen: 5 weeks 3 days ago
Title: ★★★
Joined: 3 Sep 2012
Posts: 34
Contents of Split Database Folders
Thanks dacm. I have tried again with hsqldb.jar not extracted. Here are a couple of screenshots of my Split Database folder and the Database folder within Split Database folder. Also a screenshot of the New Database window which pops up when I open mydb_wizard.odb and Enable Macros.
AttachmentSize
Create New Database Window.png 18.29 KB
Database Folder.png 30.98 KB
SplitDBStampCollection Folder.png 52.02 KB
LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on 4GB ASUS M32 i3 Desktop and LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on Core Duo 2GHz Toshiba Satellite L355 Laptop
dacm
Offline
Last seen: 6 weeks 5 days ago
Title: ★★★★
Joined: 26 Jan 2011
Posts: 84
Missing mydb.data
It looks like you’ve extracted the entire .odb file to your split database folder (SplitDBStampCollection). That’s not quite right for the current mydb_wizard.odb function. The contents of the ‘database’ subfolder are what you’re after.

Create a new folder.
Rename the contents of the current ‘database’ subfolder using a different prefix like: db.data, db.script, etc. This is to differentiate from the new database (mydb.* ) that you created with the wizard. Move these renamed (db.* ) files to the new folder you created above.

Your newly created split database folder should contain only (no subfolders):

StampCollectionWorking.odb
mydb_wizard.odb
hsqldb.jar
db.data
db.script
db.properties
db.backup (if present)
db.log (if present)

You’ll eventually be able to eliminate StampCollectionWorking.odb from the folder and then rename mydb_wizard.odb to StampCollection.odb as desired. But wait until you’ve finished moving the forms, queries, reports and macros over to mydb_wizard.odb.

dacm
Offline
Last seen: 6 weeks 5 days ago
Title: ★★★★
Joined: 26 Jan 2011
Posts: 84
Firebird vs HSQLDB
bq.. 2. Should I be concerned about doing this split and then find out that Base has moved to Firebird?

As frofa mentioned, you’re first priority is splitting your existing ‘embedded database’ into a split-database configuration for data durability. The default database in Base is largely irrelevant. The devs have chosen to eliminate Java dependencies from the default function of LibreOffice, but they are committed to maintaining Java Database Connectivity (JDBC). Since a split HSQL database requires a JDBC connection, this becomes the most important aspect of Base relative to your project going forward.

No reason to adopt Firebird:

There’s no reason to migrate your data to Firebird, although LibreOffice is already showing a certain disdain for Java Virtual Machine (JRE) support. That’s not to say they’re dropping support. Like I mentioned above, they’re quite committed to JDBC support as a distinct feature for the life of the product. But without offering JRE installation during LibreOffice installation, the task becomes more difficult for the end-user, perhaps particularly due to the associated LibreOffice setup process. Most computers today have a JRE installed, but LibreOffice no longer bundles or installs a proper JRE for the end-user as has been the practice. So it’s up to the user to install a proper 32-bit JRE as applicable (Windows and Mac) while registering that installation in Tools > Options > Advanced > Use a Java Runtime Environment (checkbox) > select an installed version (radio button selection).

Firebird database management:

While Firebird is a fine database in professional circles, it’s not well-suited for an end-user product like Base. Actually, as Base is tuned for Firebird over a number of years the end-user experience will slowly improve. But relative to a modern database engine like HSQLDB 2.x, or even the bundled HSQLDB 1.8, you’ll find that Firebird is much harder to use out-of-the-box. Firebird bears the marks of a bygone era in database history. Only the most advanced database management software is able to mask the ensuing difficulties otherwise laid upon the end-user. Such ‘difficulty’ is a boon for job-security among database administrators; after all, Firebird is a “full-scale” database product capable of supporting online banking, etc. So the scalability of a Firebird project is virtually unlimited.

That’s great news, but a typical Base user will never scale a project beyond a small office with under 100 simultaneous users, where HSQLDB shines (not to mention PostgreSQL and MySQL/MariaDB as full-scale alternatives). Unfortunately, Base users will find themselves wrestling with outdated DDL conventions to use Firebird. That is, unless we see a dramatic change in the philosophy behind the rudimentary (buggy and inadequate) database-management features in Base. The modern design of HSQLDB tends to masks these inadequacies in Base to a degree. For example, to add an auto-incrementing column (such as an AutoValue primary key) to a modern database is a simple matter of issuing an SQL (DDL) command. Likewise, that’s easy to automate through a checkbox in a GUI. In Firebird, that task involves creating a “generator” on the column, followed by writing a “trigger” (coding). You’ll find some examples on the internet, but you will need to modify the syntax for each auto-increment column as appropriate. One glance at this process should send any Base user running back to modern alternatives. Since HSQLDB is arguably the most modern, SQL-standard, easiest to use, full-featured, cross-platform, open source RDBMS available — and seamless with Base in single-user mode — I think we know where the average user will turn.

So all things considered, Java (JRE) installation is nothing compared to the difficulties users will encounter with a relic like Firebird.

That’s just my opinion, and your mileage may vary depending on the degree to which the Base developers smooth the rough edges of Firebird for the end-user. But that may take years as database management (schema development) has always been the Achilles-heel of Base.

Embedded Firebird DB limitations and data-corruption risks:

But one thing is certain, you will not be able to utilize a more advanced database manager on an embedded Firebird/HSQL database due to the proprietary Base .odb file design current lack of support for the odb file-type. And your data will remain susceptible to corruption by Base in the ‘embedded database’ packaging, due to the current implementation. So you’ll be forced to split your Firebird databases as well for data-reliability and alternative-management purposes.

In other words, the current default database option featuring single-file portability must be re-designed before it can be deemed reliable. This redesign is a simple matter of adopting a portable, split-database architecture for normal use, while offering a “Pack & Go” menu item to generate a copy of the split-database folder for single-file distribution purposes (by exception). An auto-extracting feature will round-out the redesign.

As you may know, we (the user-community) have already implemented a proof-of-concept in the form of Base templates. These “templates” require macro-support enabled in LibreOffice, but they allow us to bypass the default database engine (HSQLDB/Firebird) and the associated database creation wizards, while generating a portable, split HSQL 2.3.x database in seconds. As mentioned in the embedded database migration tutorial, a split-database folder may be moved, renamed or zipped for single-file distribution, as necessary.

So I predict you’ll have a much better user-experience with HSQLDB (perhaps particularly HSQLDB 2.x) going forward than with Firebird.

Walkinshaw
Offline
Last seen: 5 weeks 3 days ago
Title: ★★★
Joined: 3 Sep 2012
Posts: 34
Solved - Migration from Embedded to Split Database
Your expertise and patience (frofa too) are so much appreciated. I now have a working split database which makes me much more comfortable. One step at a time but I understand that the HSQLDB version from your tutorial download is 1.8? What are the advantages of going to 2.3? Your comments on Firebird are duly noted. One of these days I hope to give rather than just receive assistance on this fine forum.
LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on 4GB ASUS M32 i3 Desktop and LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on Core Duo 2GHz Toshiba Satellite L355 Laptop
dacm
Offline
Last seen: 6 weeks 5 days ago
Title: ★★★★
Joined: 26 Jan 2011
Posts: 84
HSQLDB 1.8 vs HSQLDB 2.x
Congratulations!

Perhaps add your split database specs to your signature (split HSQL 1.8 database).

I’m so thankful for frofa, oweng and many others in these forums.

Upgrading is up to you. I only caution folks to take it one step at a time during the embedded-to-split migration process, so we can isolate any issues. Date math, custom aggregates, BLOB/CLOB support, stored procedures and triggers come to mind as reasons to consider the upgrade. Make a backup of your working split database folder and give it a go. A link to the necessary HSQLDB 2.3.x file (hsqldb.jar and perhaps sqltool.jar) is included in the embedded database migration tutorial. See the NOTE under ‘Option 1: step 1.’ Make sure each of your fields have a defined length [ie VARCHAR (100) as opposed to VARCHAR alone] and the upgrade process should be automatic and trouble-free. Actually, you can run all of your databases (embedded, split, and upgraded) side-by-side to compare data and function as needed. That’s an exclusive feature available only when using macro-enhanced Base templates in support of portable split-database folders such as you’ve setup.

oweng
oweng's picture
Offline
Last seen: 5 days 10 hours ago
Title: ==Moderator==
Joined: 26 Jan 2012
Posts: 3281
extra comments moved
@DACM, I have moved my comment and your response to a separate thread here as it seemed a discussion worthy of a separate thread, rather than adding to the issue in this one, which appears to have been resolved.
Walkinshaw
Offline
Last seen: 5 weeks 3 days ago
Title: ★★★
Joined: 3 Sep 2012
Posts: 34
Upgraded to HSQL 2.3 and Encouragement to all Base users
Just a quick note to say that I recently upgraded HSQLDB from 1.8 to 2.3 (all I did was replace the hsqldb.jar file in my split database folder) and all is working fine.

One quick question; where do I find confirmation of what HSQLDB version it is within Base?

Also, as an encouragement to all Base users; since I went to the split database, it has behaved flawlessly (I am now up to around 15,000 images). I particularly like the portability issue – when I travel, I just copy my split database folder to an old laptop.
Let’s just say I am not a naturally gifted software guru; so if I can build a very useful database I would say just about anyone could.

LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on 4GB ASUS M32 i3 Desktop and LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on Core Duo 2GHz Toshiba Satellite L355 Laptop
frofa
frofa's picture
Offline
Last seen: 13 hours 24 min ago
Title: ★★★★★
Joined: 24 Feb 2012
Posts: 804
Query the HSQL 2 version
Hi again Walkinshaw:

One quick question; where do I find confirmation of what HSQLDB version it is within Base?

Try this SQL code (use ‘Create query in SQL View’ and then paste-in the code below and Save as ‘Get HSQL version’ or whatever). NOTE: This code works only in HSQLDB versions 2.x


Select TOP 1 DATABASE_VERSION() as "HSQL Version"
From INFORMATION_SCHEMA.SYSTEM_TABLES;

It should work….

Walkinshaw
Offline
Last seen: 5 weeks 3 days ago
Title: ★★★
Joined: 3 Sep 2012
Posts: 34
HSQL Version
Thanks for putting me on the right track frofa. What actually worked for me was Select DISTINCT DATABASE_VERSION() as "HSQL Version" From INFORMATION_SCHEMA.SYSTEM_TABLES

which returns 2.3.2 as my HSQL version.
Thanks again

LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on 4GB ASUS M32 i3 Desktop and LO 5.1.2.2 with HSQLDB 2.3.2 Split Database Linux Mint 17.3 KDE on Core Duo 2GHz Toshiba Satellite L355 Laptop
darkcity
darkcity's picture
Offline
Last seen: 10 weeks 6 days ago
Title: ★★★★★
Joined: 14 May 2013
Posts: 101
I’ve not been able to create
I’ve not been able to create an auto-incrementing primary key with the GUI using a split hsqldb database, as per bug https://www.libreoffice.org/bugzilla/show_bug.cgi?id=45947

but need to issue sql

ALTER TABLE "Tabelle" ALTER COLUMN "ID" INT GENERATED BY DEFAULT AS IDENTITY(START WITH 0)

Is this what other people have experienced?

dacm
Offline
Last seen: 6 weeks 5 days ago
Title: ★★★★
Joined: 26 Jan 2011
Posts: 84
darkcity, Are you familiar
darkcity,

Are you familiar with:
https://forum.openoffice.org/en/forum/viewtopic.php?p=271700#p271700

In short, HSQLDB 2.3.x includes a workaround for this Base bug. The bug is not apparent when running HSQLDB 1.8.0.10, but it becomes a problem when Base is paired with HSQLDB 2.x. If you’re using a Base template, then these settings are preset within the provided Base document (.odb). Otherwise, when using HSQLDB 2.3.x with Base, it is helpful to add these settings manually to your Base front-end (.odb) as outlined in the above link.

darkcity
darkcity's picture
Offline
Last seen: 10 weeks 6 days ago
Title: ★★★★★
Joined: 14 May 2013
Posts: 101
Great stuff, thanks for the
Great stuff, thanks for the work around. Smile

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.