TSession Events

The Session component exposes two events, OnPassword and OnStartup. The OnPassword event is triggered when an attempt is made by the application to open a Paradox table and the BDE reports

Chapter S-Data Access with Delphi

Chapter S-Data Access with Delphi insufficient access rights. The event handler for this event must respond to this anomaly. OnStartup is triggered when a session is first aztivated, Any actions that need to occur during this process can be executed through the handler for this event.

The BatchMove Component (TBatchMove)

Moving quantities of data records from one table to another is a corn-mon operation and Delphi offers two ways of performing this task. The first is to use the Table component's BatchMove method. This method is an import process in which the calling table seeks to add records from another source. The method takes two parameters: the name of the source table from which the rows will be extracted and the mode. The use of the BatchMove method is limited, however, in comparison to the functionality offered by the component that encapsulates all of Delphi's data movement capabilities, the BatchMove component.

The BatchMove component expands on that method's capabilities. Shared operations include:

Copying rows from one table to another Updating rows in a target that match those in a source table. Appending rows to a target table from the source table. ■ Deleting rows in the target that match those in the source.

In addition, the BatchMove component offers the ability to dynamically create a target table for the rows to be moved to. Data types can be explicitly mapped from the source to target, and exception handling is improved with the ability to define key violation and problem tables and the return of operational counts.

Was this article helpful?

0 0

Post a comment