create new project, select old and new version of DB files
if you want to check database version before updating (recommended), use one simple table inside your
database to save version value, e.g.
and enter SQL commands for reading and updating of version value
e.g. reading value: SELECT Version FROM Version
e.g. updating value: UPDATE Version SET Version='1.1'
run comparison of database, result is list of tables, fields and indexes changes
detected changes can be modified manually (usually only renaming of fields should be corrected,
because renamed field is detected as oldone field to remove and newone field to add)
DB Update tool updates only structure of tables, so if some data manipulations is needed
(adding new records, modifying or deleting of records), SQL commands can be used,
e.g. UPDATE Firms SET City = "New York" WHERE (Adr_City="NY");
set update properties and create output files (2 files will be created: *.info and *.model)
Step 2a - How to update database using standalone application
distribute created *.info and *.model files together with standalone update application RunMDBUpdate.exe
user can run update application manually or can be started directly from your application
for starting from application you can use parameters as follows: RunMDBUpdate.exe projectname.info or RunMDBUpdate.exe projectname.info /autorun
for auto update without user confirmation
important notice: updated database must be closed in your application before running RunMDBUpdate.exe, in other case update fails
Step 2b - How to update database using DLL library
distribute created *.info and *.model files together with library MDBUpdate.dll
in your application load this library and use function: function RunMDBUpdate(ProjectFile,UpdateFile: PChar; UpdCallBack: TUpdCallBack): boolean; StdCall;
where ProjectFile is *.info file (*.model file must be in same directory), UpdateFile is updated database file and
UpdCallBack is callback function for getting information about process of updating, definitions is: TUpdCallBack= procedure (Error: boolean; InfoStr, ErrStr: PChar) of object;
function returns true if database was updated sucesfully, in other case returns false
important notice: updated database must be closed in your application before calling MDBUpdate.dll, in other case update fails
Download demo for detailed demonstration of DB Version Update tool.