Repair Corrupt ODB file

I have a database that doesn’t have very much data in it, but for some reason, it now won’t open. When I try to open it, it says that it is corrupted and needs to be repaired. It then opens a blank ‘Writer’ document instead of Base. I’m trying to avoid reverting to a backup, but I can do that if necessary.

I have been able to succesfully recover my ODB file based on an old backup file.

  1. Backup both ODB files (damaged and backup)
  2. Open both ODB files with any zip manager program (I used 7zip)
  3. In the backup file delete in the “database” directory the files “data” and “script”
  4. Copy to the backup file the same files (“data” and “script”) from the damaged ODB (with 7zip you just have to drag and drop files from one window to the other)
  5. Open the backup ODB and it will contain all the data from your damaged ODB

It’ll probably by easier and quicker to use your backup. The default ‘embedded’ mode that Base uses to connect to the underlying HSQLDB database is inherently risky and corruption prone, so I would suggest using the much more stable ‘split’ mode to connect to your database - see HERE for information on how to do that. (PS: I have been using ‘split’ Base databases for years and have not lost any data so far - even when crashes occur as they do occasionally).