![]() | |||||||||||||||
IntroThe present section describes how to create and use a file for automatic updating of a created database. What can it be done for? If the developer of a database and its user is the same person, everything is easy in case there appears a necessity to make some changes in the database structure for example, to add a field or a report. The developer opens a work database and adds necessary elements there. And what if a database is complicated, and its structure is developed by one person (you) and is used by another one (the user) or even many people worldwide? Each of them has his or her own records in the database. At some moment of time the existing structure stops suiting users and they decide to add some fields, reports and replace used formulas. In this case, there are several variants of solution for this task:
Practically, updating is synchronization plus a script of updating that describes what elements of the database and in what way should be updated. Do not be afraid you will not have to write a script for updating; it is created automatically on the basis of any performed synchronization. Creating a file for automatic updatingTo create a file for automatic updating, you will need two databases:
To create a file for automatic updating:
That's it. Now send this file to all users, and they will be able to perform updating of their databases to a new version automatically by selecting it in the File->Update Database... menu. Recording databases versionsThus, in the paragraph above we have described how you can create a file for automatic updating for your users. However, the database changes, and it is necessary to update the database structure once again. Then one more time. It is good if all users are well-disciplined, but what can be done if some users perform the second update without the first one? For example, in the first update a form was added, and in the second update a report for a new form was added. At best the user will get an error message and at worst (if updates are more complicated) the structure of the database may be corrupted. Though before every update a backup copy of the database is created, there may occur an unpleasant situation. This question is solved by such parameter as version available for every database. For a new database a version is absent (there is an empty line). Changing and recording versions is set in the update settings:
To avoid mistakes at updates, we strongly recommend selecting both flags and specifying both values. At updating the database for the first time it is necessary to leave version_from empty, and in version_to specify, for example, "ver2". After execution of the update the database version will become equal to "ver2". At updating the database for the second time it is necessary to specify "ver2" in version_from, and in version_to, for example, "ver3". When trying to run the second update for a database having any version other than "ver2", the user will get a notification on version mismatch, and the update will not be performed. You can specify any names of versions you like, for example, upd_2008-04-20 or fix_a. If an update is not a compulsory one and does not make critical changes in the database structure (for example, adds new records to a database), it is possible to disable setting of a new version (version_to). In any case, you should seriously treat the question of keeping records on database versions if you have several users and are planning to support their databases, adding new options to them and modifying them in correspondence with users' requests. Current version of a database is shown in the main window caption, in brackets:
| |||||||||||||||
|
Copyright (C) 2001-2010 Binary Brilliant Inc. All Rights Reserved. |