[V4RB] Changing Database structure

Charles Yeomans yeomans at desuetude.com
Sun Apr 27 20:49:58 CDT 2003


On Saturday, April 26, 2003, at 07:00  PM, Stan R. Busk wrote:

> Hi,
>
> I wonder what is the best way to convert an existing static database 
> once you add a new field to one of its tables. I guess you need to 
> write a tool that create a new file with new structure, open old file 
> with old structure and copy all data from the first to the latter. Am 
> I true? Is there a better / easier way?
>
>

Here's what I do.

Copy the old-format database file to a temp file.  Open the temp file 
(as a VDatabase object), and modify its database structure using 
functions like  VDatabase.AddBaseObject, VBaseObject.AddField. Close 
the file.  Delete index files.  Swap the temp file with the old format 
file  -- since I'm Mac-only, I use a toolbox call that does this about 
as safely as possible.

Charles Yeomans



More information about the Valentina mailing list