home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / ABOUT.TXT < prev    next >
Text File  |  1997-01-16  |  3KB  |  102 lines

  1. This example demonstrates how cached updates
  2. can be used with live data and in conjunction
  3. with the UpdateSQL component for non-live data.
  4.  
  5. When working with live data, updates are
  6. performed by the BDE, otherwise the updates
  7. are performed by the UpdateSQL component.
  8.  
  9. The following is a description of what each
  10. of the controls in the main form do:
  11.  
  12.  o Cached Updates Checkbox
  13.  
  14.    This checkbox determines whether cached
  15.    updates are enabled or not.  When unchecked,
  16.    the other controls which are only relevant
  17.    while cached updates mode are disabled.
  18.    In this mode, all edits are immediately
  19.    applied to the underlying dataset.
  20.  
  21.  o UpdateSQL Checkbox
  22.  
  23.    This checkbox determines whether the
  24.    UpdateSQL component is used to perform
  25.    the cached updates.  When the user clicks
  26.    on this control to check or uncheck it,
  27.    the dataset is closed and the UpdateObject
  28.    property is set or cleared and then the
  29.    dataset is reopened.  This is required
  30.    because the UpdateObject property of
  31.    TDataSet can only be set while the dataset
  32.    is closed.  You can examine the SQL
  33.    statements used by the UpdateSQL component
  34.    by double clicking on it in the data module.
  35.  
  36.  o Apply Updates Button
  37.  
  38.    Clicking this button causes all pending
  39.    updates to be applied.
  40.  
  41.  o Cancel Updates Button
  42.  
  43.    Clicking this button causes all pending
  44.    updates to be discarded.
  45.  
  46.  o Revert Record Button
  47.  
  48.    Clicking this button causes any updates
  49.    to the current record in the grid to
  50.    be discarded.
  51.  
  52.  o Show Records Group
  53.  
  54.    Each of the check boxes in the ShowRecords
  55.    groupbox determine what types of records
  56.    are displayed in the grid.  If you change
  57.    several records, and then want to only
  58.    see those record, uncheck all the boxes
  59.    except for the one marked "modified".
  60.    If you delete a record and then later
  61.    decide you want to undelete it, check
  62.    the deleted box, and then position to
  63.    the deleted record in the grid and click
  64.    the revert record button.
  65.  
  66.  o ReExecute Query Button
  67.  
  68.    Clicking this button forces the dataset
  69.    to be closed and then reopened.
  70.  
  71. This example also uses a calculated field
  72. which shows the current update status of each
  73. record (only when cached updates are enabled).
  74.  
  75. Errors which occur during the update process
  76. are displayed in a simple form which shows
  77. the new and old values together.  There are
  78. buttons which allow the user to determine
  79. what type of action take.  To see the
  80. update error dialog in action, try changing
  81. the ProjID field of one record to be the
  82. same as the ProjID of another record.
  83. This will cause a key violation when the
  84. apply updates button is clicked.
  85. When the error dialog comes up, if
  86. you click the abort button, no updates will
  87. be performed and the dataset will be restored
  88. to the state it was in before the updates
  89. were applied.  If you click the skip button,
  90. any other changes you made will be applied,
  91. but not the one with the invalid ProjID.
  92. The last option would be to change the ProjID
  93. to something valid (such as the old value)
  94. and then click the retry button.
  95.  
  96. Cached updates provide a powerful new way of
  97. working with data in Delphi 2.0.  See the
  98. Database Application Developers Guide for a
  99. complete discussion of this new feature.
  100.  
  101.  
  102.