Question

I inherited a project that uses a pervasiveSQL database over the btrieve-Interface. Over time there has been some copying around of the data files. As it seems btrieve does not really need the ddf files; it is happy with the data files alone, so the ddf-files were not always copied with them. Over time this has led to the problem that on some installations the ddf files and the data files do not match (i.e the ddf's data definition does not match the actual table structure). This is no problem for the running version of the program, but becomes a maintenance problem, when something needs to be changed in the database structure.

So here's the question: Is there a way/tool to recreate the ddf files from the data files? To me that seems possible, because there seems to be structural information in the data files. I wouldnt mind if the recreated ddf's would loose the actual field and index names.

If that helps: There are no relations defined between the tables (there are foreign keys in the data, but the database is not told about them). So I actually only need fields and index definitions.

Was it helpful?

Solution

There is no generic tool to recreate the DDFs from the data files. You can use DDF Builder to recreate the table definitions based on data files but you will need to know the record layout.

Btrieve data files do not store field structure information. DDFs have that information and the application that generates the data files stores that information but the data files themselves do not store any field information. The only thing metadata related in Btrieve files is index information.

My suggestion would be to maintain the data files through the DDFs using CREATE TABLE / ALTER TABLE statements (or DTI/DTO) rather than making changes to the data files first and updating the DDFs second. By modifying the tables using ALTER TABLE statements, the DDFs and data files are always in sync.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top