I’ve been using DataViz SmartList To Go on my Treo 680 for some time now. I’ve recently found that Smartlist isn’t providing me with some of the features that I need for some of my newer databases. To meet those needs I’ve switched over to Mobisystems Database 7. I would highly recommend Database 7 to anyone who is looking for a relational database for use on the Palm. However, I’m not writing this to extol Database 7’s virtues, instead I’m writing to document the solution to a pretty serious problem that I encountered while using Database.
While creating a form for one of my databases something in the form tool that I had selected caused the Palm to hard reset. After the restart I found that Database was showing that I now had two copies of my database in the database list, one was located on my SD card (my original) and one was located in the Palm’s memory(the duplicate). I quickly discovered that neither of these databases would open. Each gave me an error message when I tried to open, view info, or delete them. A quick browse in my Mobisystems directory and on the Palm revealed that I did indeed have two copies and I needed to resolve this if I didn’t want to lose my form and all of my tables. I renamed the original database file using the Explorer functions of MegaLauncher and then tried to open up the database again. This apparently separated the two copies and made them unique as I was then able to open up my database again and continue working. From here I decided to go ahead and delete the extra copy of the database, thinking that I wouldn’t need it. Here’s where I made my mistake. Unfortunately, the second database was an exact copy of the original and deleting the database also deleted all of my table files. So now I had a database and forms that worked, but my tables were missing. I was able to recover most of my tables using a recovery utility on my SD card but it was a pain and only partially successful. This could have easily been prevented if I had a backup copy of the Mobisystems directory where the database files and the table files are stored.
I’ll document the steps that I figured out to resolve this in the hopes of preventing anyone else from making the same mistakes that I did.
The steps below are based upon the assumption that anyone reading this has already experienced a similar database corruption.
In order to continue you will need to have some manner of filesystem explorer and have some experience with moving around the filesystem on your Palm.
In hindsight the repair is pretty simple. Make a copy of your Mobisystems directory in it’s entirety. If you have the space to do this on your Palm or on your storage card so much the better as that will make your life a little easier. As long as you have another copy of everything in that directory you can proceed. Each of the databases has their own .PDB file named the same as the database and each table has two files, a TABLENAME.PDB and a TABLENAME_$res.PDB make sure that all are backed up somewhere safe.
In the filesystem explorer, locate the duplicate copy of your database and rename it, this will allow for the duplicate database to be deleted back in Database without generating an error message and leave you with one copy remaining. As the duplicate copy is an exact copy, this will also delete all of the tables attached to the database.
With the dust settled, copy the table files from wherever the backup copies are stored back into your Mobisystems directory. Make sure that you get the TABLENAME.PDB AND the TABLENAME_$res.PDB as both seem to be required to get things up and running again.
You should now be able to open up your copy of Database and all of your tables should work again. In my case, I found that the form that I was working on when all of this started was missing the last few changes that I had made to it, but this was still better than starting from scratch.