by driessen » Thu Mar 29, 2018 7:40 am
Jeff, this is the way I change DBF structures while upgrading my application.
I have a folder called DATA, containing all the DBF-files with the data of my application.
I have a second folder, called DATABESC, containing the same DBF-files, but only containing 1 record.
While upgrading, in de folder DATA, I take the first DBF-file (let's call it FILE1.DBF), rename it to FILE1OLD.DBF.
Then I make a new FILE1.DBF, using the structure of FILE1.DBF in the folder DATABESC.
Then I copy all the records from FIL1OLD.DBF to FILE1.DBF.
If a field is added, I give the field in my records the same value as it has in FIL1.DBF in de DATABESC-folder.
After having copied all the records to FILE1.DBF, this file has been changed to the new DBF-structure.
Finally, FILE1OLD.DBF is deleted.
So, if I need to change the DBF-structure, I change it in the DBF-file in the DATABESC-folder after which my upgrade-program is run.
I hope I was able to make myself clear.
Good luck.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773