Advantage Developer Zone


Converting Delphi TTable Instances to Advantage TAdsTable Instances

Tuesday, July 11, 2006

The easiest way to convert TTable instances to TAdsTable instances and preserve your current table configuration is to view your data form as text and then make only the necessary changes.

To Convert TTable Instances to TAdsTable Instances:


  1. Right-click on your form and choose View as Text. You will now see the text representation of your form and all of the objects on the form.
  2. From the Search menu, select Replace. In the Replace text box, replace TTable with TAdsTable.
  3. For each TTable object found, do the following:
  • Change TTable to TAdsTable. For example, the line object tblMaster: TTable would be changed to object tblMaster: TAdsTable.
  • Locate the DatabaseName property. If this property does not already include the path to your data, replace it with the path. (e.g., X:\ADS\DATA)
  • Locate the TableName property. In most circumstances your table name will change after converting to the Advantage table format (e.g., MYTABLE.DB will change to MYTABLE.ADT). If this is the case, change the TableName property to reflect this new extension.
  1. When all of the table declarations have been changed, right-click in the Edit window and select View as Form. You should now see TAdsTable objects in place of your original TTable objects.
  2. Select Save from the File menu.
  3. Once the changes have been made, the next time you build the project Delphi will warn you that some declarations have changed and offer to correct them for you. Select Yes and let Delphi correct the remaining declarations. Note: With Delphi version 5, a warning will appear at the time you save the file.

To find more answers to your technical questions, visit the Developer Zone .