Re: Changing A Btrieve index


Steven Blank
 

Wes,

Certainly good practice if you need to alter record structure.

However, if all you need to do is add, modify, or delete, one or more indexes, then you don't need to rebuild the file; you can just drop and/or create index(es) in place, via either the Btrieve Maintenance Utility (my preference) or Open:Reindex.

Steve Blank

At 04:00 PM 1/24/2017, you wrote:

Jim,

Unless someone else knows a way, you must copy the original definition in your control file that matches your clients data with a new file name, create a program to export/import the data either with a link create or import/export text files, then update the definition with the file changes you need.

Your original file will not be corrupted, any programs using the original file will get a Definition Mismatch error and close.

There are 2 ways to hande the conversion, 1) if you have a small number of clients, put the conversion program in the menus and run it when you give them the update, or 2) this is my process to run the conversion automatically. Keep in mind I haven't worked in 8.3 for about 10 years so hopefully this should work. Don't beleive 8.3 has an else option for blocks so you will probably need to create 2 sepearate ones.


Create 2 logical virtuals in the main program v.DefinitionMismatch, v.ConversionError


Call a subtask to Declare the file in question that may require conversion, if there is an error, set Magic to ignore it and update v.DefinitionMismatch to True

Block: v.DefinitionMismatch = True

Rename file to the conversion file name

Run the conversion - send the v.ConversionError virtual to this program and on any error trap it and set v.ConversionError to True.

Block: v.ConversionError = False

Delete renamed conversion file

Else

Delete new file created

Rename old file back to original name so you don't lose data.

End Block

update v.DefinitionMistach and v.ConversionError to false

End Block


Repeat for additional conversions


Wes

Join main@magicu-l.groups.io to automatically receive all group messages.