Conversion of Old Applications

The prototype of TQDBView, TQDBPanel, was a descendant of TPanel and had to be associated with a TQDB component to handle the actual QDB file. The situation has been reversed in the current release. TQDBView (and TQDBItem) descend from TQDB and, as such, handle their own QDB files. TQDBView is now a non-visual component with a Panel property connecting it to the panel it is to manage. The change in architecture now concentrates the database management in the TQDBView component instead of distributing it between TQDBPanel and TQDB. The shift makes TQDBView much more flexible than TQDBPanel but creates some complexity in converting existing applications from TQDBPanel to TQDBView. If you follow the steps below, however, it shouldn't be too difficult.

Before you do anything make a backup of you original filesall of them code and data. Make two! Be careful ...

  • Firstbefore loading the project in Delphiuse the provided ConvQDB utility on the units of your application. ConvQDB lets you choose a .pas file and then loads it and the associated .dfm file into its editor panes. You need to think carefully about the changes to make. In simple applications you will want to change every occurrence of TQDBPanel into TPanel and every TQDB into TQDBView. To help you do this (in both .pas and .dfm panes) I have provided a simple search button to locate the next instance of the string "TQDB". ConvQDB saves the original files with extensions .paq and .dfq so you can recover them if necessary.

  • Once you have used ConvQDB you should be able to load the files into the Delphi IDE and complete the conversion by hand. On loading you will may get some error messages about unknown properties in the .dfm file but these should be harmless enough to ignore. For example, the TQDBPanel had a QDB property which is absent in the TPanel it has been transformed into.

  • The remainder of the conversion has two parts: one mechanical and the other more careful. The mechanical process involves transferring database actions from objects which were TQDBPanels (and are now ordinary TPanels) to objects which were TQDBs (and are now TQDBViews).

  • The more careful part requires checking your application's logic to make sure it does the same job with the different division of responsibilities between TQDBView and TPanel. It can be easy, for example, to forget to replace property values that were lost in the form conversioncheck the backup copies of the old dfm files to jog your memory. Another common glitch occurs when a TQDBPanel had its Enabled property set false. In operation it would have been toggled as necessary as the database was accessed. Now it will just sit there making you wonder why you can't browse the fileremove it.