Subject Re: converting tables back from level 7 to 5
From Mervyn Bick <invalid@invalid.invalid>
Date Fri, 10 Sep 2021 11:12:26 +0200
Newsgroups dbase.getting-started

On 2021/09/10 09:55, Rouke wrote:
> I'm currently using db2019 and 5.7 side by side and haven't paid too much attention and certain level 5 tables have been converted to level 7. I know I can change the level  to 5 in the BDE administrator, but will this automatically convert level 7 tables back to level 5? If not, is there an easy way to convert them back to level 5?

I'm afraid setting the level to 5 in the BDE Administrator won't
automatically convert level 7 tables back to level 5.

Even copying the level 7 tables to new tables won't change the level.

It's not difficult to do the conversion, just a bit "fiddly".  Make sure
you have an up-to-date backup before you start.

Change the table level in the BDE Administrator from 7 to 5.  Do this
with dBASE closed.  You will then need to create NEW level 5 tables and
then append the data from the original level 7 tables.

cretable7.prg in the dUFLP will create the code you need for recreating
tables and indexes.  Before you create the new tables make sure you
haven't used features not found in level 5 tables such as long
fieldnames or autoinc fields.

Probably the simplest way is to use cretable7.prg to process all the
tables in a folder as it will accept * as a wildcard for the table name.

do :duflp:cretable7 with'*.dbf'

If you don't want specific tables processed it is probably easier to
process them all and then delete unwanted tables from the file
cretable7.prg produces (cretable.txt) than to process them one by one.

I haven't actually tried this but if you rename cretable.txt
cretable.prg you should be able to execute it to recreate all the
tables.  Run this in a new folder. Do NOT run it in the folder with your
original tables as there is code to delete each table if it exists.
Mind you, this could be an option if you have a full backup tucked away

A small XDML program to open each new table in turn and then append from
the original table will complete the task.

I have to go out so I'm afraid I don't have time to give you example
code at the moment but if you need it let me know and I'll do it later.