There are several problems with .DBT files, which are:

  1. An attached table is missing;

  2. An index, just added, doesn't work;

  3. The .DBT file is corrupt, resulting in inability to login to the application

The first problem, a missing table, has one of two probable causes:

Almost always, it is the first problem. To solve this, attach the table and use Define_Database to save the database definition. The fastest way to run Define_Database in OpenInsight is to open Database Manager and choose Save from the Database menu.

The second problem is similar to the first, but it shows itself in a different manner – a non-working index. When an index is added to a table that has no indexes, the system creates a new table to store the index information. This table is called a “bang table”, because its name is the same as the data table but has an exclamation point (a “bang”) glued on the front. The solution is to attach the data table (which will automatically attach the dictionary and index tables, if they exist) and then use Define_Database to save the database definition.

The last problem happens rarely, but it has happened. The easiest way to fix this is to pull the affected .DBT from a backup.

If the backup .DBT is lost, use the following procedure to recover:

  1. Assuming your database name is EXAMPLES, so your .DBT file is named EXAMPLES.DBT;

  2. Rename EXAMPLES.DBT to EXAMPLES.BAK, making a temporary backup;

  3. Make a copy of SYSPROG.DBT; name the copy EXAMPLES.DBT;

  4. Log into the EXAMPLES application.

What this does is start the EXAMPLES database out with just the system tables attached. Now you have to go back into Database Manager (or use the command line) to attach the tables necessary for your application. Once you have done that, use Define_Database to save the database definition. After you are happy that EXAMPLES is working well again, make a back up.

You should update your .DBT (using Define_Database) whenever the following occur:

When using the system tools (as opposed to the command line), the .DBT file is usuallyupdated in each of these cases except in the case of adding and removing indexes.