TDADataTable

Overview

TDADataTable is the abstract base class for all client data table implementations in Data Abstract.

Client Data Tables are classes that hold live data on the client application at runtime, to make it available to application code and visual controls. Client Data Tables can be filled from a remote source (typically a server) using a remote data adapter that coordinates the connection to the server; they maintain a local history of changes (Delta) and can apply those changes back to the database, again using the Remote Data Adapter.

Data Abstract currently provides implementation of client data table in form of the TDAMemDataTable component.

Other implementations (TDACDSDataTable and TDAADODataTable) are supported for backward compatibility only.

Location


 

constructor Create  override

Standard component constructor

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner

Active

Manages whether the dataset is currently active (open) or not. Setting this property to true will automatically open the dataset, while setting it to false will automatically close it.

property Active: Boolean read write

AddRecord

Adds record to the data table with FieldValues values for FieldNames fields.

procedure AddRecord(const FieldNames: array of string; const FieldValues: array of Variant)

Parameters:

  • FieldNames: array with fields' names of added record
  • FieldValues: array with values for FieldNames fields of added record

Append

Appends record to the data table Dataset

procedure Append

ApplyUpdates  dynamic

Applies all pending changes stored in the data table's Delta to the server, using the RemoteDataAdapter.UpdateDataCall.

function ApplyUpdates(RefetchAll: Boolean; ReturnToCurrentRecord: Boolean): Boolean

Parameters:

  • RefetchAll: if set to True then data table is closed an opened again thus refetching all the data from the server. False by default.
  • ReturnToCurrentRecord: indicates that current record position should be saved and set after applying updates. False by default.

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

AttachEventHooks  protected virtual

Enables event handlers of data table's Dataset - assigns these event handlers to appropriate Internal event handler

procedure AttachEventHooks(aDataset: TDataset)

Parameters:

  • aDataset: events of aDataset dataset will be attached

AutoIncs  protected

Array of negative values that is used for inserting new rows with AutoInc fields on the client. Length of this array is equal to the number of data table fields.

property AutoIncs: TAutoIncArray read write

BOF

Indicates whether reading the dataset has reached the beginning of the recordset (BOF = Beginning of File). BOF will only turn true if neither an empty dataset was opened or Prior was called while the cursor was already on the first record (it will not turn to true when reaching the first record).

property BOF: Boolean read

BookmarkValid

Returns True if bookmarked record exists

function BookmarkValid(Bookmark: TBookmark): Boolean

Parameters:

  • Bookmark: bookmark of the data table that is checked

BusinessEventsObj

Represents a collection of Business Rules (see more in Business_Rules_in_Depth_(Delphi)) for current strongly typed data table

property BusinessEventsObj: TDADataTableRules read

BusinessRulesID

Used for associating current strongly typed data table to a business helper class . It should correspond to a value used in RegisterDataTableRules method, called in initialization section of the business helper class unit.

property BusinessRulesID: string read write

CallScript

Calls aEvent script procedure from ScriptCode

procedure CallScript(const aEvent: string)

Parameters:

  • aEvent: name of the script procedure that should be called

Cancel

Cancels the current operation and puts the data table's Dataset in dsBrowse state.

procedure Cancel

CancelUpdateChange

Cancels delta Change for the data table.

procedure CancelUpdateChange(Change: TDADeltaChange; IncludeDetails: Boolean)

Parameters:

  • Change: delta change that should be canceled
  • IncludeDetails: indicates if delta changes should be canceled in detail tables too.

CancelUpdates

Discards all pending changes stored in the data table's Delta, reverting the data to the state after the last download or call to ApplyUpdates.

procedure CancelUpdates(IncludeDetails: Boolean)

Parameters:

  • IncludeDetails: indicates if delta changes should be canceled in detail tables too.

CheckProperties  virtual

Validates the data table properties.

procedure CheckProperties

ClearFields

Clears the contents of all fields for the active record.

procedure ClearFields

ClearRows

Deletes all the rows from data table. If aClearDelta is True then LogChanges is set to False and data table's delta is cleared

procedure ClearRows(const aClearDelta: Boolean)

Parameters:

  • aClearDelta: If True then LogChanges is set to False and data table's delta is cleared

CloneCursor  protected virtual

Sets Source data table as CloneSource for current data table, shares its data and opens both Source and cloned data tables.

procedure CloneCursor(Source: TDADataTable)

Parameters:

  • Source: data table that is Source for cloning

CloneSelectedRecord (TDADataTable, Boolean)  overload

Inserts current record of Source dataset in the data table

procedure CloneSelectedRecord(Source: TDADataTable; DoPost: Boolean)

Parameters:

  • Source: external dataset from where record will be copied
  • DoPost: determines if Post should be called after insert. Has True value by default.

CloneSelectedRecord (IDADataset, Boolean)  overload

Inserts current record of Source dataset in the data table

procedure CloneSelectedRecord(const Source: IDADataset; DoPost: Boolean)

Parameters:

  • Source: external dataset from where record will be copied
  • DoPost: determines if Post should be called after insert. Has True value by default.

CloneSource

Points on data table that is a source for current cloned data table

property CloneSource: TDADataTable read

Close

Closes the dataset and discards any local data that had been retrieved from the database.

procedure Close

Closing

Returns whether the data table is currently closing (true) or not (false).

property Closing: Boolean read

ControlsDisabled

Indicates whether data-aware controls update their display to reflect changes to the data table.

function ControlsDisabled: Boolean

CopyRecordSet

Allows to duplicate recordset.

procedure CopyRecordSet(aSource: TDADataTable; aPreserveLookupFields: Boolean; aPreserveCalcFields: Boolean)

Parameters:

  • aSource: Source
  • aPreserveLookupFields: Preserve lookup fields
  • aPreserveCalcFields: Preserve calculated fields

CreateAutoIncArray  protected

Prepares array for AutoIncs - set it's length equal to data table fields count and fill it with -1 values.

function CreateAutoIncArray: TAutoIncArray

CreateInternalFields  protected virtual

Creates fields for aDataset from internal fields collection

procedure CreateInternalFields(aDataset: TDataset; someFieldDefinitions: TDAFieldCollection)

Parameters:

  • aDataset: Dataset where fields will be created
  • someFieldDefinitions: parameter is not used

CurrRecId

Number of the next record that will be added in the data table

property CurrRecId: Integer read write

CustomAttributes

Custom attributes of the data table. Could be used for example for permissions defining.

property CustomAttributes: TStrings read write

DataReaderFirst  protected safecall

If RecordCount of the data table is more then zero then moves cursor on the first record and returns True. record count

function DataReaderFirst: Boolean

DataReaderNext  protected safecall

If cursor of the data table doesn't point on EOF then moves cursor on the next record and returns True

function DataReaderNext: Boolean

Dataset

Reads DataSet to access the internal dataset that TDADataTable uses to fetch data from the server.

property Dataset: TDataset read

Dataset_Locate  protected safecall

Implements Locate method of IDADataset - searching a dataset for a specified record and making it the active record.

function Dataset_Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean

Parameters:

  • KeyFields: Identifies the field or fields (semicolon-separated list) in the dataset that must be matched in a lookup dataset when doing Locate
  • KeyValues: value or values of KeyFileds fields that are looked for in the data table
  • Options: indicates whether the search is case insensitive (loCaseInsensitive) and whether partial matches are supported (loPartialKey).

Dataset_Lookup  protected safecall

Implements Lookup method of IDADataset - retrieves field values from a record that matches specified search values (KeyValues)

function Dataset_Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant

Parameters:

  • KeyFields: identifies the field or fields (semicolon-separated list) in the dataset that must be matched in a lookup dataset when doing a lookup.
  • KeyValues: value or values of KeyFileds fields that are looked for in the data table
  • ResultFields: semicolon-separated list of fields which values should be returned

Delete

Deletes current record in data table

procedure Delete

Delta

Maintains the local changes to the data table that have not yet been applied back to the server.

property Delta: IDADelta read write

DeltaInitialized

Returns True if data table has not nil Delta

property DeltaInitialized: Boolean read

DetachEventHooks  protected virtual

detach all data tables's Dataset events - assigns theses event handlers to nil

procedure DetachEventHooks(aDataset: TDataset)

Parameters:

  • aDataset: events of aDataset dataset will be detached

DetailFields

Holds the field or list of fields from the current data table that make up the foreign key of a Master/Detail relationship. These fields will be matched against the MasterFields from the MasterSource table.

property DetailFields: string read write

DetailOptions

Specifies how changes to the master affect the detail table in a Master/Detail relationship.

property DetailOptions: TDADetailOptions read write

DetectPKDuplicates  protected

Indicates if data table should be checked on primary key duplicates before doing Post

property DetectPKDuplicates: Boolean read write

DisableConstraints  virtual abstract

Disables data table constraints defined on the server temporarily

procedure DisableConstraints

DisableControls

Disables data display in data-aware controls associated with the data table.

procedure DisableControls

DisableEventHandlers

detach all data tables's Dataset events - assigns these event handlers to nil.

procedure DisableEventHandlers

DisableUserEventHandlers

disable data table's events temporarily. Each time DisableUserEventHandlers is called, a reference count is incremented. While the reference count is greater than zero, event handlers are not enforced on the data table. Always call DisableUserEventHandlers and EnableUserEventHandlers in paired blocks to ensure that event handlers are enabled when you intend them to be.

procedure DisableUserEventHandlers

DoAfterCloseDataset  protected virtual

does necessary actions after closing dataset - calls business rules script AfterClose and set CloneSource to nil

procedure DoAfterCloseDataset

DoAfterOpenDataset  protected virtual

does necessary actions after opening dataset, such as calling of business rules script AfterOpen

procedure DoAfterOpenDataset

DoBeforeCloseDataset  protected virtual

does necessary actions before closing dataset, such as calling of business rules script BeforeClose

procedure DoBeforeCloseDataset

DoBeforeOpenDataset  protected virtual

does necessary actions before opening dataset, such as calling of business rules script BeforeOpen

procedure DoBeforeOpenDataset

DoCascadeOperation

Does cascade operation for data table with master/detail relationship, such as cascade open/close, cascade delete, etc

procedure DoCascadeOperation(aStreamer: TDADataStreamer; aOption: TDAMasterOption)

Parameters:

  • aStreamer: used for reading datasets if All in one fetch feature is selected, but only in the case if master or detail data table don't support RemoteFetchEnabled or they should be filled from different data adapters
  • aOption: indicates what operation should be performed for the data table with master/detail relationship

DoOpen  protected virtual

Opens data table

procedure DoOpen(IgnoreAutoFetchSettings: Boolean)

Parameters:

  • IgnoreAutoFetchSettings: if data table is detail table in master/detail relationship and master table is active this option specifies that data tabe should be opened, no matter if dtAutoFetch option set for it or not.

DoRefresh  protected

Refreshes data table, simply closes it and opens again

procedure DoRefresh(aDataset: TDataset)

Parameters:


DoSort  protected virtual abstract

Sorts data table reacords

procedure DoSort(const FieldNames: array of string; const Directions: array of TDASortDirection)

Parameters:

  • FieldNames: array of field names on which sorting should be done
  • Directions: array with sort directions specified for every field from FieldNames array

DynamicOrder

property DynamicOrder: TDAOrderByItems read

DynamicWhere

This property is used to dynamically build WHERE statements.

property DynamicWhere: TDAWhereBuilder read write

Edit

Enables editing of data in the dataset.

procedure Edit

EditableDataset_AddRecord  protected safecall

Inserts record to the data table with FieldValues values for FieldNames fields.

procedure EditableDataset_AddRecord(const FieldNames: array of string; const FieldValues: array of Variant)

Parameters:

  • FieldNames: array with fields' names of added record
  • FieldValues: array with values for FieldNames fields of added record

Editing

Returns whether the data table is currently in editing mode (true) or not (false).

property Editing: Boolean read

EnableConstraints  virtual abstract

Enables data table constraints defined on the server, that were disabled by DisableConstraints method

procedure EnableConstraints

EnableControls

Enables data display in data-aware controls associated with the data table.

procedure EnableControls

EnableEventHandlers

Enables event handlers of data table's Dataset - assigns these event handlers to appropriate Internal event handler

procedure EnableEventHandlers

EnableUserEventHandlers

Re-enables event handlers of data table. Each time EnableUserEventHandlers is called, a reference count is decremented. When the reference count is equal to zero, event handlers are enabled again. Always call DisableUserEventHandlers and EnableUserEventHandlers in paired blocks to ensure that event handlers are enabled when you intend them to be.

procedure EnableUserEventHandlers

Eof

Indicates whether reading the dataset has reached the end of the recordset (EOF = End of File). EOF will only turn true if neither an empty dataset was opened or Next was called while the cursor was already on the last record (it will not turn to true when reaching the last record).

property Eof: Boolean read

ExportDelta

Exports current delta

function ExportDelta: IDADelta

Fetching

Returns whether the data table is currently fetching data form a remote source (true) or not (false).

property Fetching: Boolean read

FetchMastersDetails  dynamic

Fetches details records for appropriate master record

procedure FetchMastersDetails(aMasterTable: TDADataTable; aRequestMappings: TStrings; IgnoreAutoFetchSettings: Boolean)

Parameters:

  • aMasterTable: master table of current data table
  • aRequestMappings: list of binded pairs parameter from detail table and field name from master table. aRequestMappings parameter is not usually used, cause for master/detail relationship based on Where statement it isn't required at all and for legacy based on Params and Request relationships appropriate parameter receives it's value in master detail wizard
  • IgnoreAutoFetchSettings: if master table for current data table is active this option specifies that data table should be opened, no matter if dtAutoFetch option set for it or not.

FieldByName

Finds a field based on its name. If the specified field does not exist, FieldByName raises an exception.

function FieldByName(const aName: string): TDAField

Parameters:

  • aName: name of the searched field

FieldCount

Gets the number of Fields contained in the dataset.

property FieldCount: Integer read

Fields

Provides access to all the fields contained in the dataset.

property Fields: TDAFieldCollection read write

FieldValues

Gives convenient access to all the fields values of the current record without having to go though the Fields collection property.

property FieldValues[Index: Integer]: Variant read

Filter

Use Filter to specify a data table filter. When filtering is applied to a data table, only those records that meet a filter's conditions are available.

property Filter: string read write

Filtered

Specifies whether or not filtering is active for a data table.

property Filtered: Boolean read write

FindField

Returns an item with the specified name.

function FindField(const aName: string): TDAField

Parameters:

  • aName: name of the searched field

First

Moves to the first record of the dataset

procedure First

FreeBookmark

Frees the resources allocated for a specified bookmark

procedure FreeBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: bookmark that should be freed

GetAsBoolean (Integer): Boolean  protected overload safecall

Represents the field's value of data table specified by index as a boolean value

function GetAsBoolean(Index: Integer): Boolean

Parameters:

  • Index: index of data table's field

GetAsBoolean (string): Boolean  protected overload safecall

Represents the field's value of data table specified by name as a boolean value

function GetAsBoolean(const FieldName: string): Boolean

Parameters:

  • FieldName: name of data table's field

GetAsCurrency (Integer): Currency  protected overload safecall

Represents the field's value of data table specified by index as a currency value

function GetAsCurrency(Index: Integer): Currency

Parameters:

  • Index: index of data table's field

GetAsCurrency (string): Currency  protected overload safecall

Represents the field's value of data table specified by name as a currency value

function GetAsCurrency(const FieldName: string): Currency

Parameters:

  • FieldName: name of data table's field

GetAsDateTime (Integer): TDateTime  protected overload safecall

Represents the field's value of data table specified by index as a datetime value

function GetAsDateTime(Index: Integer): TDateTime

Parameters:

  • Index: index of data table's field

GetAsDateTime (string): TDateTime  protected overload safecall

Represents the field's value of data table specified by name as a datetime value

function GetAsDateTime(const FieldName: string): TDateTime

Parameters:

  • FieldName: name of data table's field

GetAsFloat (Integer): Double  protected overload safecall

Represents the field's value of data table specified by index as a float value

function GetAsFloat(Index: Integer): Double

Parameters:

  • Index: index of data table's field

GetAsFloat (string): Double  protected overload safecall

Represents the field's value of data table specified by name as a float value

function GetAsFloat(const FieldName: string): Double

Parameters:

  • FieldName: name of data table's field

GetAsInteger (Integer): Integer  protected overload safecall

Represents the field's value of data table specified by index as a integer value

function GetAsInteger(Index: Integer): Integer

Parameters:

  • Index: index of data table's field

GetAsInteger (string): Integer  protected overload safecall

Represents the field's value of data table specified by name as a integer value

function GetAsInteger(const FieldName: string): Integer

Parameters:

  • FieldName: name of data table's field

GetAsString (Integer): string  protected overload safecall

Represents the field's value of data table specified by index as a string value

function GetAsString(Index: Integer): string

Parameters:

  • Index: index of data table's field

GetAsString (string): string  protected overload safecall

Represents the field's value of data table specified by name as a string value

function GetAsString(const FieldName: string): string

Parameters:

  • FieldName: name of data table's field

GetAsVariant (Integer): Variant  protected overload safecall

Represents the field's value of data table specified by index as a variant value

function GetAsVariant(Index: Integer): Variant

Parameters:

  • Index: index of data table's field

GetAsVariant (string): Variant  protected overload safecall

Represents the field's value of data table specified by name as a variant value

function GetAsVariant(const FieldName: string): Variant

Parameters:

  • FieldName: name of data table's field

GetBOF  protected

Determines whether data table cursor reached the beginning of the dataset

function GetBOF: Boolean

GetBookmark

Allocates a bookmark for the active record in the dataset.

function GetBookmark: TBookmark

GetCloneSource

Returns data table that is a clone source for the current data table

function GetCloneSource: TDADataTable

GetDataset  protected safecall

Returns dataset of current data table

function GetDataset: TDataset

GetDatasetClass  protected virtual abstract

Returns class of data table's dataset.

function GetDatasetClass: TDatasetClass

GetDetailDataTables

Returns list of detail datasets for the current master data table

function GetDetailDataTables: TDADataTableList

GetDetailTablesforAllinOneFetch

Forms lists of detail tables (aSame and aOther) for current master data table for which dtIncludeInAllInOneFetch option is set (automatic downloading data for this detail table when filling the master)

procedure GetDetailTablesforAllinOneFetch(aSame: TDADataTableList; aOther: TDADataTableList; aRecursive: Boolean)

Parameters:

  • aSame: list of details tables for current master data table, that support RemoteFetchEnabled and filled frrom the same data adapter as master data table. Master table should support RemoteFetchEnabled also
  • aOther: details tables for current master data table that either don't support RemoteFetchEnabled or filled from another data adapter them master table
  • aRecursive: specifies that filling of aSame and aOther lists should performed recursively for multi-level master/detail

GetDetailTablesforApplyUpdate

Forms list of detail tables for current master table which should automatically apply detail changes to the server when ApplyUpdates is called on the master.

function GetDetailTablesforApplyUpdate(aRecursive: Boolean): TDADataTableList

Parameters:

  • aRecursive: specifies that filling of detail tables lists should performed recursively for multi-level master/detail

GetEOF  protected

Determines whether data table cursor reached the end of the dataset

function GetEOF: Boolean

GetFieldIndexes  protected safecall

Returns index of data table's field specified by name

function GetFieldIndexes(const aName: string): Integer

Parameters:

  • aName: name of data table's field

GetFieldNames  protected safecall

Returns name of data table's field specified by index

function GetFieldNames(Index: Integer): string

Parameters:

  • Index: index of data table's fieldIndex of the field

GetIsServer  protected

Implements GetIsServer method of IDAScriptContext interface- gets a flag indicating wherther the Script is being executed by a server application or not. For TDADataTable returns false

function GetIsServer: Boolean

Returns MasterLink

function GetMasterDataLink: TMasterDataLink

GetMasterDataTable

Returns data table that is a master for the current data table in Master/Detail relationship

function GetMasterDataTable: TDADataTable

GetName  protected safecall

Returns name of the data table - either LogicalName or Name of the TDADataTable instance (in the case if LogicalName is empty)

function GetName: string

GetNames  protected

Returns data table's field name specified by Index

function GetNames(Index: Integer): string

Parameters:

  • Index: index of data table field

GetOldValue (TField): Variant  protected overload

Contains the original value of a changed field.

function GetOldValue(aField: TField): Variant

Parameters:

  • aField: field

GetOldValue (Integer): Variant  protected overload

Contains the original value of a changed field.

function GetOldValue(aIndex: Integer): Variant

Parameters:

  • aIndex: field index

GetParams  protected safecall

Returns list of data table parameters

function GetParams: TDAParamCollection

GetRangeState  protected virtual

Indicates if range is set for the data table

function GetRangeState: Boolean

GetReadOnly  protected virtual

Indicates whether the data table is read-only (true) or not (false, default). If table is read-only, no changes to the data contained in the table will be permitted.

function GetReadOnly: Boolean

GetRecordCount  protected

Returns number of records in the data table

function GetRecordCount: Integer

GetSchema  protected

Returns schema of the database

function GetSchema: TDAClientSchema

GetSession  protected

Implements GetSession method of IDAScriptContext interface - gets current Session instance. For TDADataTable always gets nil as scripts being executed by a client application.

function GetSession: IDAScriptSession

GetSimpleCloneSource  protected

Returns data table that is a clone source for the current data table

function GetSimpleCloneSource: TObject

GetUsingClonedCursor

Indicates if CloneSource is assigned

function GetUsingClonedCursor: Boolean

GotoBookmark

Positions on the record to which a specified bookmark points.

procedure GotoBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: record identified by this Bookmark should be active

HasDelta

Indicates whether the current dataset contains any unapplied deltas or not.

property HasDelta: Boolean read

HasDeltaRecursive

Returns whether the current dataset or any of its detail tables contain any unapplied deltas or not.

property HasDeltaRecursive: Boolean read

HasReducedDelta

Indicates if data table Delta is reduced.

property HasReducedDelta: Boolean read

ImportDelta

Imports external delta.

procedure ImportDelta(aDelta: IDADelta)

Parameters:

  • aDelta: delta

Insert

Inserts a new record in the data table

procedure Insert

intDATypeToVCLType  protected virtual

Returns appropriate standart field type for DA field type. For example, ftString for datString

function intDATypeToVCLType(aDAType: TDADataType): TFieldType

Parameters:

  • aDAType: DA type of field

InterfaceSupportsErrorInfo  protected stdcall

Indicates whether an interface supports the IErrorInfo interface.

function InterfaceSupportsErrorInfo(const iid: TGUID): HResult

Parameters:

  • iid: GUID or name of interface that should be checked

IsCanEditCurrentRow

Indicates if the current record isn't locked by other tables.

function IsCanEditCurrentRow: Boolean

IsDeltaInitialized  protected safecall

Indicates if the data table has not nil Delta

function IsDeltaInitialized: Boolean

IsEmpty

Indicates whether the dataset is empty (true) or not (false).

property IsEmpty: Boolean read

isPKDuplicateDetected  protected virtual

Checks before posting changes if primary key of edited record already exists in the data table

function isPKDuplicateDetected: Boolean

IsUserEventHandlersDisabled

Checks if event handlers were disabled by DisableUserEventHandlers method

function IsUserEventHandlersDisabled: Boolean

Last

Moves to the last record of the data table

procedure Last

LoadFromFile

Loads the content of the data table, including the Delta, from a local briefcase file.

procedure LoadFromFile(const aFileName: string)

Parameters:

  • aFileName: name of the file from where content of the data table should be loaded

LoadFromRemoteSource  virtual

Fills the data table with data from the server, using the RemoteDataAdapter. GetDataCall. If the MaxRecords property does not equal -1, the method loads the next MaxRecords records.

procedure LoadFromRemoteSource(BookmarkPosition: Boolean)

Parameters:

  • BookmarkPosition: indicates if cursor position should be saved before loading data and restore after that

LoadFromStream

Loads the content of the data table, including the Delta, from a stream.

procedure LoadFromStream(aStream: TStream)

Parameters:

  • aStream: stream from where data table is loaded

LoadSchema

Downloads the schema for the data table from the server, using the RemoteDataAdapter.GetSchemaCall and fills the Fields and Params collections based on the newly obtained schema information.

procedure LoadSchema(PreserveLookupFields: Boolean; PreserveClientCalcFields: Boolean)

Parameters:

  • PreserveLookupFields: indicates if Lookup Fields should be saved and added after schema was loaded from the server
  • PreserveClientCalcFields: indicates if Calculated Fields should be saved and added after schema was loaded from the server

LoadScript

Fills the ScriptCode property by downloading the appropriate script from the server, using the RemoteDataAdapter.GetScriptsCall. For business rules scripts to run, a ScriptingProvider must be assigned.

procedure LoadScript(aDatasetName: string)

Parameters:

  • aDatasetName: parameter is not used

Locate

Searches a dataset for a specified record and making it the active record.

function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean

Parameters:

  • KeyFields: identifies the field or fields (semicolon-separated list) in the dataset that must be matched in a lookup dataset when doing Locate
  • KeyValues: value or values of KeyFileds fields that are looked for in the data table
  • Options: indicates whether the search is case insensitive (loCaseInsensitive) and whether partial matches are supported (loPartialKey).

LogChanges

Manages whether the data table will keep track of the changes made to its data using a Delta (true, default), or not (false). If set to false, no log of changes will be kept, and any changes made to the table will not be applied back to the back-end database.

property LogChanges: Boolean read write

LogicalName

Defines the name of the data table. This name will be used to identify the table when retrieving data from or applying changes back to the server, and will typically match the name of the table defined in the server-side schema.

property LogicalName: string read write

Lookup

Retrieves the field values from the record that matches the specified search values.

function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant

Parameters:

  • KeyFields: identifies the field or fields (semicolon-separated list) in the dataset that must be matched in a lookup dataset when doing a lookup.
  • KeyValues: Values specified by the Variant or Variant array.
  • ResultFields: semicolon-separated list of fields which values should be returned

MasterFields

Holds the field or list of fields from the master data table that make up the foreign key of a Master/Detail relationship. These fields will be matched against the DetailFields from the detail table.

property MasterFields: string read write

Allows to establish Master/Detail relationship. It is used internally in master/detail operations

property MasterLink: TMasterDataLink read

MasterMappingMode

Specifies how values of the MasterFields will be passed to the server to fetch detail data.

property MasterMappingMode: TDAMasterMappingMode read write

MasterOptions

Controls how changes to the master affect the detail table in a Master/Detail relationship.

property MasterOptions: TDAMasterOptions read write

MasterParamsMappings

Defines the mapping of MasterFields to data table parameters if the MasterMappingMode is set to mmParams.

property MasterParamsMappings: TStrings read write

MasterRequestMappings

Sets the mapping of MasterFields to data request parameters if the MasterMappingMode is set to mmDataRequest.

property MasterRequestMappings: TStrings read write

MasterSource

Specifies the data source (and thereby the data table) that acts as master for the current table, in a Master/Detail relationship.

property MasterSource: TDADataSource read write

MaxRecords

Assigns the maximum number of records to retrieve from the server when opening the data table. A value of -1 (default) will download all records.

property MaxRecords: Integer read write

MergeDelta  virtual

Merges the changes stored in the Delta into the base data of the data table and clears the delta. This persists the changes in the local data, but removes them from the Delta so they will not be (re-)applied to the server. You will not usually call this method directly, it is used internally by ApplyUpdates. Call this method if you want to explicitly prevent pending changes from being applied to the server, but keep them in the local data table. For example, after applying changes to the server, an application might delete records from the data table that are no longer needed locally to keep the memory footprint of the application small. After doing so, it would call MergeDelta to ensure these deletes will not be propagated to the server. (Alternatively, the application could also set LogChanges to false while performing the deletes.)

procedure MergeDelta

Names

Gives convenient access to all the fields names of the current data table without having to go through the Fields collection property.

property Names[Index: Integer]: string read

Moves to the next record in the data table, making it the active record.

procedure Next

Notification  protected override

Forwards notification messages to all owned components.

procedure Notification(AComponent: TComponent; Operation: TOperation)

Parameters:

  • AComponent: component
  • Operation: operation

NotifyFieldsClear  protected virtual

Notifies datasources about clearing fields when controls are disabled

procedure NotifyFieldsClear

OnAfterApplyUpdates

Fires right after the data table has finished applying updates to the server.

property OnAfterApplyUpdates: TDADataTableNotifyEvent read write
delegate: procedure OnAfterApplyUpdates(DataTable: TDADataTable)

OnAfterCancel

fires after changes are cancelled for data table

property OnAfterCancel: TDADataTableNotifyEvent read write
delegate: procedure OnAfterCancel(DataTable: TDADataTable)

OnAfterClose

fires after data table is closed

property OnAfterClose: TDADataTableNotifyEvent read write
delegate: procedure OnAfterClose(DataTable: TDADataTable)

OnAfterDataRequestCall

Fires right after the data table has finished a data request call to the server.

property OnAfterDataRequestCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnAfterDataRequestCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnAfterDataUpdateCall

Fires right after the data table has finished a data update call to the server.

property OnAfterDataUpdateCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnAfterDataUpdateCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnAfterDelete

fires after record was deleted from data table

property OnAfterDelete: TDADataTableNotifyEvent read write
delegate: procedure OnAfterDelete(DataTable: TDADataTable)

OnAfterEdit

fires after record was edited in data table

property OnAfterEdit: TDADataTableNotifyEvent read write
delegate: procedure OnAfterEdit(DataTable: TDADataTable)

OnAfterFieldChange

Fires right after a field was changed.

property OnAfterFieldChange: TDADataTableDataChangeEvent read write
delegate: procedure OnAfterFieldChange(DataTable: TDADataTable; Field: TDAField)

OnAfterInsert

fires after record was inserted in data table

property OnAfterInsert: TDADataTableNotifyEvent read write
delegate: procedure OnAfterInsert(DataTable: TDADataTable)

OnAfterMergeDelta

Fires right after the data table has finished merging deltas received from the server.

property OnAfterMergeDelta: TDADataTableNotifyEvent read write
delegate: procedure OnAfterMergeDelta(DataTable: TDADataTable)

OnAfterOpen

fires after data table was opened

property OnAfterOpen: TDADataTableNotifyEvent read write
delegate: procedure OnAfterOpen(DataTable: TDADataTable)

OnAfterPost

fires after record was posted in data table

property OnAfterPost: TDADataTableNotifyEvent read write
delegate: procedure OnAfterPost(DataTable: TDADataTable)

OnAfterRefresh

fires after data table was refreshed

property OnAfterRefresh: TDADataTableNotifyEvent read write
delegate: procedure OnAfterRefresh(DataTable: TDADataTable)

OnAfterSchemaCall

Fires after schema was loaded for the data table

property OnAfterSchemaCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnAfterSchemaCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnAfterScriptCall

Fires right after the data table has finished a script call to the server.

property OnAfterScriptCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnAfterScriptCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnAfterScroll

fires after current record was changed in data table

property OnAfterScroll: TDADataTableNotifyEvent read write
delegate: procedure OnAfterScroll(DataTable: TDADataTable)

OnBeforeApplyUpdates

Fires just before the data table starts applying updates to the server.

property OnBeforeApplyUpdates: TDABeforeApplyUpdatesEvent read write
delegate: procedure OnBeforeApplyUpdates(DataTable: TDADataTable; const Delta: IDADelta)

OnBeforeCancel

fires before changes in data table are cancelled

property OnBeforeCancel: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeCancel(DataTable: TDADataTable)

OnBeforeClose

fires before data table is closed

property OnBeforeClose: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeClose(DataTable: TDADataTable)

OnBeforeDataRequestCall

Fires just before the data table starts a data request call to the server.

property OnBeforeDataRequestCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnBeforeDataRequestCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnBeforeDataUpdateCall

Fires just before the data table starts a data update call to the server.

property OnBeforeDataUpdateCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnBeforeDataUpdateCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnBeforeDelete

fires before record in data table is deleted

property OnBeforeDelete: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeDelete(DataTable: TDADataTable)

OnBeforeEdit

fires before record is edited in data table

property OnBeforeEdit: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeEdit(DataTable: TDADataTable)

OnBeforeFieldChange

Fires just before field will be changed during the update process

property OnBeforeFieldChange: TDADataTableDataChangeEvent read write
delegate: procedure OnBeforeFieldChange(DataTable: TDADataTable; Field: TDAField)

OnBeforeInsert

fires before record is inserted in data table

property OnBeforeInsert: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeInsert(DataTable: TDADataTable)

OnBeforeMergeDelta

Fires just before delta is merged

property OnBeforeMergeDelta: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeMergeDelta(DataTable: TDADataTable)

OnBeforeOpen

fires before data table is opened

property OnBeforeOpen: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeOpen(DataTable: TDADataTable)

OnBeforePost

fires before record is posted in data table

property OnBeforePost: TDADataTableNotifyEvent read write
delegate: procedure OnBeforePost(DataTable: TDADataTable)

OnBeforeRefresh

fires before data table is refreshed

property OnBeforeRefresh: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeRefresh(DataTable: TDADataTable)

OnBeforeSchemaCall

Fires before schema will be loaded for the data table

property OnBeforeSchemaCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnBeforeSchemaCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnBeforeScriptCall

Fires just before the data table starts a script call to the server.

property OnBeforeScriptCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnBeforeScriptCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnBeforeScroll

fires before current record is changed in data table

property OnBeforeScroll: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeScroll(DataTable: TDADataTable)

OnCalcFields

Fires when calculated field need to be recalculated

property OnCalcFields: TDADataTableNotifyEvent read write
delegate: procedure OnCalcFields(DataTable: TDADataTable)

OnDeleteError

Fires whenever error is ocured when doing Delete

property OnDeleteError: TDADataTableErrorEvent read write
delegate: procedure OnDeleteError(DataTable: TDADataTable; Error: EDatabaseError; var Action: TDataAction)

OnEditError

Fires wheneve error is ocured when doing Edit

property OnEditError: TDADataTableErrorEvent read write
delegate: procedure OnEditError(DataTable: TDADataTable; Error: EDatabaseError; var Action: TDataAction)

OnFilterRecord

Fires when data is loaded into the data table and filtering is active for the data table

property OnFilterRecord: TDADataTableFilterEvent read write
delegate: procedure OnFilterRecord(DataTable: TDADataTable; var Accept: Boolean)

OnMasterChange  protected virtual

Fires whenever current record of master data table is changed - either by moving to another record or by editing record. Fetches detail records for the changed master record.

procedure OnMasterChange(Sender: TObject)

Parameters:

  • Sender: indicates which component called the event handler

OnMasterDisable  protected virtual

Occurs when the source dataset becomes inactive. Currently not implemented.

procedure OnMasterDisable(Sender: TObject)

Parameters:

  • Sender: indicates which component called the event handler

OnMergeDeltaUnknownChange

Fires if key field names contain values that couldn't be found in the data table

property OnMergeDeltaUnknownChange: TDAMergeDeltaUnknownChangeEvent read write
delegate: procedure OnMergeDeltaUnknownChange(DataTable: TDADataTable; const Delta: IDADelta; const Change: TDADeltaChange)

OnNewRecord

Fires whenever a new record is added to the data table

property OnNewRecord: TDADataTableNotifyEvent read write
delegate: procedure OnNewRecord(DataTable: TDADataTable)

OnPostError

Fires whenever error is ocured when doing Post

property OnPostError: TDADataTableErrorEvent read write
delegate: procedure OnPostError(DataTable: TDADataTable; Error: EDatabaseError; var Action: TDataAction)

OnReceiveDataStream

Fires when data is loaded into the data table from a LocalSchema

property OnReceiveDataStream: TDADataRequestStreamEvent read write
delegate: procedure OnReceiveDataStream(DataTable: TDADataTable; Stream: TStream)

OnScriptError

Fires whenever error is ocured during script execution initiated by CallScript operation

property OnScriptError: TDAScriptErrorNotifyEvent read write
delegate: procedure OnScriptError(DataTable: TDADataTable; E: EDAScriptError; var raiseException: Boolean)

Open

Opens the dataset and prepares it for fetching records from the database. If the dataset is not empty, the cursor will be placed on the first available record; otherwise, EOF will be set to true to indicate that the end of the (empty) record set has been reached.

procedure Open

Opening

Indicates whether the data table is currently opening (true) or not (false).

property Opening: Boolean read

ParamByName

Locates a specific parameter, based on its name. If no matching parameter is defined, an exception will be raised.

function ParamByName(const aName: string): TDAParam

Parameters:

  • aName: name of the parameter

Params

Provides access to the list of parameters defined for the command.

property Params: TDAParamCollection read write

PlainWhereClause

Allows to sent "where" clause as text. for backward purposes only. Use DynamicWhere instead of

property PlainWhereClause: string read write

Post

Saves changes in the data table

procedure Post

Prior

Moves to the previous record of the data table

procedure Prior

QueryInterface  protected override

Returns a reference to a specified interface if the object supports that interface. This is one of the methods introduced by the IUnknown interface.

function QueryInterface(const IID: TGUID; out Obj: ): HResult

Parameters:

  • IID: Identifier of the interface to return
  • Obj: nterface specified by IID

ReadDeltaFromStream (TDADataStreamer, TList<TDADeltaChange>)  overload

Reads the data table's delta from the streamer. If delta's change has csFailed status - add it to the list of failed deltas. Reads also deltas of detail tables for current master table which should automatically apply detail changes to the server.

procedure ReadDeltaFromStream(aStreamer: TDADataStreamer; aFailedDeltas: TList<TDADeltaChange>)

Parameters:

  • aStreamer: steamer that contains delta
  • aFailedDeltas: list of failed delta's changes

ReadDeltaFromStream (TDADataStreamer, Boolean, Boolean)  overload

procedure ReadDeltaFromStream(aStreamer: TDADataStreamer; aOnlyWithSameDataAdapter: Boolean; aRecursive: Boolean)

Parameters:

  • aStreamer:
  • aOnlyWithSameDataAdapter:
  • aRecursive:

ReadOnly

Manages whether the data table is read-only (true) or not (false, default). If enabled, no changes to the data contained in the table will be permitted.

property ReadOnly: Boolean read write

RecIDField

Unvisible field that is created for every data table and contains number of record. Used for internal operations, such as saving cursor position before and returning to it after applying updates to the server.

property RecIDField: TDAIntegerField read write

RecIDValue

value of RecIDField for the current record of the data table

property RecIDValue: Integer read

RecNo

Indicates the active record in the dataset.

property RecNo: Integer read write

RecordCount

Returns the number of records currently contained in the data table.

property RecordCount: Integer read

Refresh

Re-fetches data from the database to update a dataset's view of data.

procedure Refresh

RefreshFromServer

Receive data from the database to update dataet's view of data. After receiving it compares existing records with received records and replaces changed records with new ones or inserts new ones

procedure RefreshFromServer

RefreshRow

Reloads current record from the database

procedure RefreshRow

RemoteDataAdapter

Specifies the TDARemoteDataAdapter used to exchange data with the server. Remote data adapters handle the communication between the data table and the server and are needed for retrieving data from and applying changes to the server.

property RemoteDataAdapter: TDACustomDataAdapter read write

RemoteFetchEnabled

Decides whether the data table will be filled from a remote source using a TDARemoteDataAdapter or TDALocalDataAdapter (true, default), or manually (false). If enabled, the RemoteDataAdapter property must be assigned to establish the link to the server.

property RemoteFetchEnabled: Boolean read write

RemoteUpdatesOptions

Provides options for applying updates to the server. Available options include:

  • Changes to records will automatically be applied to the server as they are posted. Enable this option to achieve behavior similar to single- or two-tier database applications, where posting a record in the user interface will directly apply the change to the back-end database. This basically triggers an automatic call to ApplyUpdates for each record change.
property RemoteUpdatesOptions: TDARemoteUpdatesOptions read write

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure ROFreeNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure RORemoveFreeNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

RowHelper_GetPreviousValues  protected

function RowHelper_GetPreviousValues(aName: Variant): Variant

Parameters:

  • aName:

RowHelper_GetTableName  protected

function RowHelper_GetTableName: string

RowHelper_SetCurrentValues  protected

procedure RowHelper_SetCurrentValues(aName: Variant; aValue: Variant)

Parameters:

  • aName:
  • aValue:

SafeCallException  override

Handles exceptions in methods that use safecall directive.

function SafeCallException(ExceptObject: TObject; ExceptAddr: Pointer): HResult

Parameters:

  • ExceptObject: Exception object.
  • ExceptAddr: Address of the exception.

SaveToFile

Saves the current content of the data table, including the Delta, to a local briefcase file.

procedure SaveToFile(const aFileName: string)

Parameters:

  • aFileName: name of the file where data table content should be saved to

SaveToStream

Saves the current content of the data table, including the Delta, to a stream.

procedure SaveToStream(aStream: TStream)

Parameters:

  • aStream: stream where data table should be saved to

ScriptCode

Contains the Business Rules Script code for the data table. This property can either be assigned manually, or filled from the server using the LoadScript method. For business rules scripts to run, a ScriptingProvider must be assigned.

property ScriptCode: TStrings read write

ScriptingProvider    (declared in TScriptableComponent)

Component which performs the execution of the script.

property ScriptingProvider: TDABaseScriptingProvider read write

SendRemoveNotification  protected    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure SendRemoveNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

Sort

Sorts the data table.

procedure Sort(const FieldNames: array of string; const Directions: array of TDASortDirection)

Parameters:

  • FieldNames: array of field names on which sorting should be done
  • Directions: array with sort directions (asceding or desceding) specified for every field from FieldNames array

SortDirections

Array of sort directions (ascending or desendig) that defines direction of sorting for every field of the data table. Length of the SortDirections array should be equal to the count of fields of the data table.

property SortDirections: TDASortDirectionArray read

SortFieldNames

Use SortFieldNames to specify the fields that should be used to order the records in the data table.

property SortFieldNames: TStringArray read

State

Examine State to determine the current operating mode of the dataset. State determines what can be done with data in a dataset, such as editing existing records or inserting new ones. The dataset state constantly changes as an application processes data.

property State: TDataSetState read

StoreActive

Decides whether the Active property will be stored in the Delphi DFM file (true) or not (false, default). If set to true, setting Active to true at design-time (for example to see live data) will persist this property to the DFM, and the data table will automatically be opened at runtime. If set to false, the data table will not open at runtime until explicitly being opened from code - allowing, for example, to perform additional configurations such as loading the server address from a config file before the table opens.

property StoreActive: Boolean read write

StreamingOptions

Configures options for the streaming behavior of the data table. Available options include:

  • Any schema information sent from the server as part of the data packet will be ignored and the data table will maintain its predefined schema. If not present, schema information present in the data stream can override the configured field settings.
  • The data table's notification events for data or row changes will not fire during streaming processes while downloading new data or applying changes (default).
property StreamingOptions: TDAStreamingOptions read write

UnSort

Unsorts the data table.

procedure UnSort

UsingClonedCursor

Returns True if data table has assigned CloneSource

property UsingClonedCursor: Boolean read

WriteDeltaToStream

Writes Deltas to stream via given streamer.

procedure WriteDeltaToStream(aStreamer: TDADataStreamer; aOnlyWithSameDataAdapter: Boolean; aRecursive: Boolean)

Parameters:

  • aStreamer: streamer
  • aOnlyWithSameDataAdapter: required mode
  • aRecursive:

 

Active

Manages whether the dataset is currently active (open) or not. Setting this property to true will automatically open the dataset, while setting it to false will automatically close it.

property Active: Boolean read write

AutoIncs  protected

Array of negative values that is used for inserting new rows with AutoInc fields on the client. Length of this array is equal to the number of data table fields.

property AutoIncs: TAutoIncArray read write

BOF

Indicates whether reading the dataset has reached the beginning of the recordset (BOF = Beginning of File). BOF will only turn true if neither an empty dataset was opened or Prior was called while the cursor was already on the first record (it will not turn to true when reaching the first record).

property BOF: Boolean read

BusinessEventsObj

Represents a collection of Business Rules (see more in Business_Rules_in_Depth_(Delphi)) for current strongly typed data table

property BusinessEventsObj: TDADataTableRules read

BusinessRulesID

Used for associating current strongly typed data table to a business helper class . It should correspond to a value used in RegisterDataTableRules method, called in initialization section of the business helper class unit.

property BusinessRulesID: string read write

CloneSource

Points on data table that is a source for current cloned data table

property CloneSource: TDADataTable read

Closing

Returns whether the data table is currently closing (true) or not (false).

property Closing: Boolean read

CurrRecId

Number of the next record that will be added in the data table

property CurrRecId: Integer read write

CustomAttributes

Custom attributes of the data table. Could be used for example for permissions defining.

property CustomAttributes: TStrings read write

Dataset

Reads DataSet to access the internal dataset that TDADataTable uses to fetch data from the server.

property Dataset: TDataset read

Delta

Maintains the local changes to the data table that have not yet been applied back to the server.

property Delta: IDADelta read write

DeltaInitialized

Returns True if data table has not nil Delta

property DeltaInitialized: Boolean read

DetailFields

Holds the field or list of fields from the current data table that make up the foreign key of a Master/Detail relationship. These fields will be matched against the MasterFields from the MasterSource table.

property DetailFields: string read write

DetailOptions

Specifies how changes to the master affect the detail table in a Master/Detail relationship.

property DetailOptions: TDADetailOptions read write

DetectPKDuplicates  protected

Indicates if data table should be checked on primary key duplicates before doing Post

property DetectPKDuplicates: Boolean read write

DynamicOrder

property DynamicOrder: TDAOrderByItems read

DynamicWhere

This property is used to dynamically build WHERE statements.

property DynamicWhere: TDAWhereBuilder read write

Editing

Returns whether the data table is currently in editing mode (true) or not (false).

property Editing: Boolean read

Eof

Indicates whether reading the dataset has reached the end of the recordset (EOF = End of File). EOF will only turn true if neither an empty dataset was opened or Next was called while the cursor was already on the last record (it will not turn to true when reaching the last record).

property Eof: Boolean read

Fetching

Returns whether the data table is currently fetching data form a remote source (true) or not (false).

property Fetching: Boolean read

FieldCount

Gets the number of Fields contained in the dataset.

property FieldCount: Integer read

Fields

Provides access to all the fields contained in the dataset.

property Fields: TDAFieldCollection read write

FieldValues

Gives convenient access to all the fields values of the current record without having to go though the Fields collection property.

property FieldValues[Index: Integer]: Variant read

Filter

Use Filter to specify a data table filter. When filtering is applied to a data table, only those records that meet a filter's conditions are available.

property Filter: string read write

Filtered

Specifies whether or not filtering is active for a data table.

property Filtered: Boolean read write

HasDelta

Indicates whether the current dataset contains any unapplied deltas or not.

property HasDelta: Boolean read

HasDeltaRecursive

Returns whether the current dataset or any of its detail tables contain any unapplied deltas or not.

property HasDeltaRecursive: Boolean read

HasReducedDelta

Indicates if data table Delta is reduced.

property HasReducedDelta: Boolean read

IsEmpty

Indicates whether the dataset is empty (true) or not (false).

property IsEmpty: Boolean read

LogChanges

Manages whether the data table will keep track of the changes made to its data using a Delta (true, default), or not (false). If set to false, no log of changes will be kept, and any changes made to the table will not be applied back to the back-end database.

property LogChanges: Boolean read write

LogicalName

Defines the name of the data table. This name will be used to identify the table when retrieving data from or applying changes back to the server, and will typically match the name of the table defined in the server-side schema.

property LogicalName: string read write

MasterFields

Holds the field or list of fields from the master data table that make up the foreign key of a Master/Detail relationship. These fields will be matched against the DetailFields from the detail table.

property MasterFields: string read write

Allows to establish Master/Detail relationship. It is used internally in master/detail operations

property MasterLink: TMasterDataLink read

MasterMappingMode

Specifies how values of the MasterFields will be passed to the server to fetch detail data.

property MasterMappingMode: TDAMasterMappingMode read write

MasterOptions

Controls how changes to the master affect the detail table in a Master/Detail relationship.

property MasterOptions: TDAMasterOptions read write

MasterParamsMappings

Defines the mapping of MasterFields to data table parameters if the MasterMappingMode is set to mmParams.

property MasterParamsMappings: TStrings read write

MasterRequestMappings

Sets the mapping of MasterFields to data request parameters if the MasterMappingMode is set to mmDataRequest.

property MasterRequestMappings: TStrings read write

MasterSource

Specifies the data source (and thereby the data table) that acts as master for the current table, in a Master/Detail relationship.

property MasterSource: TDADataSource read write

MaxRecords

Assigns the maximum number of records to retrieve from the server when opening the data table. A value of -1 (default) will download all records.

property MaxRecords: Integer read write

Names

Gives convenient access to all the fields names of the current data table without having to go through the Fields collection property.

property Names[Index: Integer]: string read

Opening

Indicates whether the data table is currently opening (true) or not (false).

property Opening: Boolean read

Params

Provides access to the list of parameters defined for the command.

property Params: TDAParamCollection read write

PlainWhereClause

Allows to sent "where" clause as text. for backward purposes only. Use DynamicWhere instead of

property PlainWhereClause: string read write

ReadOnly

Manages whether the data table is read-only (true) or not (false, default). If enabled, no changes to the data contained in the table will be permitted.

property ReadOnly: Boolean read write

RecIDField

Unvisible field that is created for every data table and contains number of record. Used for internal operations, such as saving cursor position before and returning to it after applying updates to the server.

property RecIDField: TDAIntegerField read write

RecIDValue

value of RecIDField for the current record of the data table

property RecIDValue: Integer read

RecNo

Indicates the active record in the dataset.

property RecNo: Integer read write

RecordCount

Returns the number of records currently contained in the data table.

property RecordCount: Integer read

RemoteDataAdapter

Specifies the TDARemoteDataAdapter used to exchange data with the server. Remote data adapters handle the communication between the data table and the server and are needed for retrieving data from and applying changes to the server.

property RemoteDataAdapter: TDACustomDataAdapter read write

RemoteFetchEnabled

Decides whether the data table will be filled from a remote source using a TDARemoteDataAdapter or TDALocalDataAdapter (true, default), or manually (false). If enabled, the RemoteDataAdapter property must be assigned to establish the link to the server.

property RemoteFetchEnabled: Boolean read write

RemoteUpdatesOptions

Provides options for applying updates to the server. Available options include:

  • Changes to records will automatically be applied to the server as they are posted. Enable this option to achieve behavior similar to single- or two-tier database applications, where posting a record in the user interface will directly apply the change to the back-end database. This basically triggers an automatic call to ApplyUpdates for each record change.
property RemoteUpdatesOptions: TDARemoteUpdatesOptions read write

ScriptCode

Contains the Business Rules Script code for the data table. This property can either be assigned manually, or filled from the server using the LoadScript method. For business rules scripts to run, a ScriptingProvider must be assigned.

property ScriptCode: TStrings read write

ScriptingProvider    (declared in TScriptableComponent)

Component which performs the execution of the script.

property ScriptingProvider: TDABaseScriptingProvider read write

SortDirections

Array of sort directions (ascending or desendig) that defines direction of sorting for every field of the data table. Length of the SortDirections array should be equal to the count of fields of the data table.

property SortDirections: TDASortDirectionArray read

SortFieldNames

Use SortFieldNames to specify the fields that should be used to order the records in the data table.

property SortFieldNames: TStringArray read

State

Examine State to determine the current operating mode of the dataset. State determines what can be done with data in a dataset, such as editing existing records or inserting new ones. The dataset state constantly changes as an application processes data.

property State: TDataSetState read

StoreActive

Decides whether the Active property will be stored in the Delphi DFM file (true) or not (false, default). If set to true, setting Active to true at design-time (for example to see live data) will persist this property to the DFM, and the data table will automatically be opened at runtime. If set to false, the data table will not open at runtime until explicitly being opened from code - allowing, for example, to perform additional configurations such as loading the server address from a config file before the table opens.

property StoreActive: Boolean read write

StreamingOptions

Configures options for the streaming behavior of the data table. Available options include:

  • Any schema information sent from the server as part of the data packet will be ignored and the data table will maintain its predefined schema. If not present, schema information present in the data stream can override the configured field settings.
  • The data table's notification events for data or row changes will not fire during streaming processes while downloading new data or applying changes (default).
property StreamingOptions: TDAStreamingOptions read write

UsingClonedCursor

Returns True if data table has assigned CloneSource

property UsingClonedCursor: Boolean read

 

constructor Create  override

Standard component constructor

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner

AddRecord

Adds record to the data table with FieldValues values for FieldNames fields.

procedure AddRecord(const FieldNames: array of string; const FieldValues: array of Variant)

Parameters:

  • FieldNames: array with fields' names of added record
  • FieldValues: array with values for FieldNames fields of added record

Append

Appends record to the data table Dataset

procedure Append

ApplyUpdates  dynamic

Applies all pending changes stored in the data table's Delta to the server, using the RemoteDataAdapter.UpdateDataCall.

function ApplyUpdates(RefetchAll: Boolean; ReturnToCurrentRecord: Boolean): Boolean

Parameters:

  • RefetchAll: if set to True then data table is closed an opened again thus refetching all the data from the server. False by default.
  • ReturnToCurrentRecord: indicates that current record position should be saved and set after applying updates. False by default.

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

AttachEventHooks  protected virtual

Enables event handlers of data table's Dataset - assigns these event handlers to appropriate Internal event handler

procedure AttachEventHooks(aDataset: TDataset)

Parameters:

  • aDataset: events of aDataset dataset will be attached

BookmarkValid

Returns True if bookmarked record exists

function BookmarkValid(Bookmark: TBookmark): Boolean

Parameters:

  • Bookmark: bookmark of the data table that is checked

CallScript

Calls aEvent script procedure from ScriptCode

procedure CallScript(const aEvent: string)

Parameters:

  • aEvent: name of the script procedure that should be called

Cancel

Cancels the current operation and puts the data table's Dataset in dsBrowse state.

procedure Cancel

CancelUpdateChange

Cancels delta Change for the data table.

procedure CancelUpdateChange(Change: TDADeltaChange; IncludeDetails: Boolean)

Parameters:

  • Change: delta change that should be canceled
  • IncludeDetails: indicates if delta changes should be canceled in detail tables too.

CancelUpdates

Discards all pending changes stored in the data table's Delta, reverting the data to the state after the last download or call to ApplyUpdates.

procedure CancelUpdates(IncludeDetails: Boolean)

Parameters:

  • IncludeDetails: indicates if delta changes should be canceled in detail tables too.

CheckProperties  virtual

Validates the data table properties.

procedure CheckProperties

ClearFields

Clears the contents of all fields for the active record.

procedure ClearFields

ClearRows

Deletes all the rows from data table. If aClearDelta is True then LogChanges is set to False and data table's delta is cleared

procedure ClearRows(const aClearDelta: Boolean)

Parameters:

  • aClearDelta: If True then LogChanges is set to False and data table's delta is cleared

CloneCursor  protected virtual

Sets Source data table as CloneSource for current data table, shares its data and opens both Source and cloned data tables.

procedure CloneCursor(Source: TDADataTable)

Parameters:

  • Source: data table that is Source for cloning

CloneSelectedRecord (TDADataTable, Boolean)  overload

Inserts current record of Source dataset in the data table

procedure CloneSelectedRecord(Source: TDADataTable; DoPost: Boolean)

Parameters:

  • Source: external dataset from where record will be copied
  • DoPost: determines if Post should be called after insert. Has True value by default.

CloneSelectedRecord (IDADataset, Boolean)  overload

Inserts current record of Source dataset in the data table

procedure CloneSelectedRecord(const Source: IDADataset; DoPost: Boolean)

Parameters:

  • Source: external dataset from where record will be copied
  • DoPost: determines if Post should be called after insert. Has True value by default.

Close

Closes the dataset and discards any local data that had been retrieved from the database.

procedure Close

ControlsDisabled

Indicates whether data-aware controls update their display to reflect changes to the data table.

function ControlsDisabled: Boolean

CopyRecordSet

Allows to duplicate recordset.

procedure CopyRecordSet(aSource: TDADataTable; aPreserveLookupFields: Boolean; aPreserveCalcFields: Boolean)

Parameters:

  • aSource: Source
  • aPreserveLookupFields: Preserve lookup fields
  • aPreserveCalcFields: Preserve calculated fields

CreateAutoIncArray  protected

Prepares array for AutoIncs - set it's length equal to data table fields count and fill it with -1 values.

function CreateAutoIncArray: TAutoIncArray

CreateInternalFields  protected virtual

Creates fields for aDataset from internal fields collection

procedure CreateInternalFields(aDataset: TDataset; someFieldDefinitions: TDAFieldCollection)

Parameters:

  • aDataset: Dataset where fields will be created
  • someFieldDefinitions: parameter is not used

DataReaderFirst  protected safecall

If RecordCount of the data table is more then zero then moves cursor on the first record and returns True. record count

function DataReaderFirst: Boolean

DataReaderNext  protected safecall

If cursor of the data table doesn't point on EOF then moves cursor on the next record and returns True

function DataReaderNext: Boolean

Dataset_Locate  protected safecall

Implements Locate method of IDADataset - searching a dataset for a specified record and making it the active record.

function Dataset_Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean

Parameters:

  • KeyFields: Identifies the field or fields (semicolon-separated list) in the dataset that must be matched in a lookup dataset when doing Locate
  • KeyValues: value or values of KeyFileds fields that are looked for in the data table
  • Options: indicates whether the search is case insensitive (loCaseInsensitive) and whether partial matches are supported (loPartialKey).

Dataset_Lookup  protected safecall

Implements Lookup method of IDADataset - retrieves field values from a record that matches specified search values (KeyValues)

function Dataset_Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant

Parameters:

  • KeyFields: identifies the field or fields (semicolon-separated list) in the dataset that must be matched in a lookup dataset when doing a lookup.
  • KeyValues: value or values of KeyFileds fields that are looked for in the data table
  • ResultFields: semicolon-separated list of fields which values should be returned

Delete

Deletes current record in data table

procedure Delete

DetachEventHooks  protected virtual

detach all data tables's Dataset events - assigns theses event handlers to nil

procedure DetachEventHooks(aDataset: TDataset)

Parameters:

  • aDataset: events of aDataset dataset will be detached

DisableConstraints  virtual abstract

Disables data table constraints defined on the server temporarily

procedure DisableConstraints

DisableControls

Disables data display in data-aware controls associated with the data table.

procedure DisableControls

DisableEventHandlers

detach all data tables's Dataset events - assigns these event handlers to nil.

procedure DisableEventHandlers

DisableUserEventHandlers

disable data table's events temporarily. Each time DisableUserEventHandlers is called, a reference count is incremented. While the reference count is greater than zero, event handlers are not enforced on the data table. Always call DisableUserEventHandlers and EnableUserEventHandlers in paired blocks to ensure that event handlers are enabled when you intend them to be.

procedure DisableUserEventHandlers

DoAfterCloseDataset  protected virtual

does necessary actions after closing dataset - calls business rules script AfterClose and set CloneSource to nil

procedure DoAfterCloseDataset

DoAfterOpenDataset  protected virtual

does necessary actions after opening dataset, such as calling of business rules script AfterOpen

procedure DoAfterOpenDataset

DoBeforeCloseDataset  protected virtual

does necessary actions before closing dataset, such as calling of business rules script BeforeClose

procedure DoBeforeCloseDataset

DoBeforeOpenDataset  protected virtual

does necessary actions before opening dataset, such as calling of business rules script BeforeOpen

procedure DoBeforeOpenDataset

DoCascadeOperation

Does cascade operation for data table with master/detail relationship, such as cascade open/close, cascade delete, etc

procedure DoCascadeOperation(aStreamer: TDADataStreamer; aOption: TDAMasterOption)

Parameters:

  • aStreamer: used for reading datasets if All in one fetch feature is selected, but only in the case if master or detail data table don't support RemoteFetchEnabled or they should be filled from different data adapters
  • aOption: indicates what operation should be performed for the data table with master/detail relationship

DoOpen  protected virtual

Opens data table

procedure DoOpen(IgnoreAutoFetchSettings: Boolean)

Parameters:

  • IgnoreAutoFetchSettings: if data table is detail table in master/detail relationship and master table is active this option specifies that data tabe should be opened, no matter if dtAutoFetch option set for it or not.

DoRefresh  protected

Refreshes data table, simply closes it and opens again

procedure DoRefresh(aDataset: TDataset)

Parameters:


DoSort  protected virtual abstract

Sorts data table reacords

procedure DoSort(const FieldNames: array of string; const Directions: array of TDASortDirection)

Parameters:

  • FieldNames: array of field names on which sorting should be done
  • Directions: array with sort directions specified for every field from FieldNames array

Edit

Enables editing of data in the dataset.

procedure Edit

EditableDataset_AddRecord  protected safecall

Inserts record to the data table with FieldValues values for FieldNames fields.

procedure EditableDataset_AddRecord(const FieldNames: array of string; const FieldValues: array of Variant)

Parameters:

  • FieldNames: array with fields' names of added record
  • FieldValues: array with values for FieldNames fields of added record

EnableConstraints  virtual abstract

Enables data table constraints defined on the server, that were disabled by DisableConstraints method

procedure EnableConstraints

EnableControls

Enables data display in data-aware controls associated with the data table.

procedure EnableControls

EnableEventHandlers

Enables event handlers of data table's Dataset - assigns these event handlers to appropriate Internal event handler

procedure EnableEventHandlers

EnableUserEventHandlers

Re-enables event handlers of data table. Each time EnableUserEventHandlers is called, a reference count is decremented. When the reference count is equal to zero, event handlers are enabled again. Always call DisableUserEventHandlers and EnableUserEventHandlers in paired blocks to ensure that event handlers are enabled when you intend them to be.

procedure EnableUserEventHandlers

ExportDelta

Exports current delta

function ExportDelta: IDADelta

FetchMastersDetails  dynamic

Fetches details records for appropriate master record

procedure FetchMastersDetails(aMasterTable: TDADataTable; aRequestMappings: TStrings; IgnoreAutoFetchSettings: Boolean)

Parameters:

  • aMasterTable: master table of current data table
  • aRequestMappings: list of binded pairs parameter from detail table and field name from master table. aRequestMappings parameter is not usually used, cause for master/detail relationship based on Where statement it isn't required at all and for legacy based on Params and Request relationships appropriate parameter receives it's value in master detail wizard
  • IgnoreAutoFetchSettings: if master table for current data table is active this option specifies that data table should be opened, no matter if dtAutoFetch option set for it or not.

FieldByName

Finds a field based on its name. If the specified field does not exist, FieldByName raises an exception.

function FieldByName(const aName: string): TDAField

Parameters:

  • aName: name of the searched field

FindField

Returns an item with the specified name.

function FindField(const aName: string): TDAField

Parameters:

  • aName: name of the searched field

First

Moves to the first record of the dataset

procedure First

FreeBookmark

Frees the resources allocated for a specified bookmark

procedure FreeBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: bookmark that should be freed

GetAsBoolean (Integer): Boolean  protected overload safecall

Represents the field's value of data table specified by index as a boolean value

function GetAsBoolean(Index: Integer): Boolean

Parameters:

  • Index: index of data table's field

GetAsBoolean (string): Boolean  protected overload safecall

Represents the field's value of data table specified by name as a boolean value

function GetAsBoolean(const FieldName: string): Boolean

Parameters:

  • FieldName: name of data table's field

GetAsCurrency (Integer): Currency  protected overload safecall

Represents the field's value of data table specified by index as a currency value

function GetAsCurrency(Index: Integer): Currency

Parameters:

  • Index: index of data table's field

GetAsCurrency (string): Currency  protected overload safecall

Represents the field's value of data table specified by name as a currency value

function GetAsCurrency(const FieldName: string): Currency

Parameters:

  • FieldName: name of data table's field

GetAsDateTime (Integer): TDateTime  protected overload safecall

Represents the field's value of data table specified by index as a datetime value

function GetAsDateTime(Index: Integer): TDateTime

Parameters:

  • Index: index of data table's field

GetAsDateTime (string): TDateTime  protected overload safecall

Represents the field's value of data table specified by name as a datetime value

function GetAsDateTime(const FieldName: string): TDateTime

Parameters:

  • FieldName: name of data table's field

GetAsFloat (Integer): Double  protected overload safecall

Represents the field's value of data table specified by index as a float value

function GetAsFloat(Index: Integer): Double

Parameters:

  • Index: index of data table's field

GetAsFloat (string): Double  protected overload safecall

Represents the field's value of data table specified by name as a float value

function GetAsFloat(const FieldName: string): Double

Parameters:

  • FieldName: name of data table's field

GetAsInteger (Integer): Integer  protected overload safecall

Represents the field's value of data table specified by index as a integer value

function GetAsInteger(Index: Integer): Integer

Parameters:

  • Index: index of data table's field

GetAsInteger (string): Integer  protected overload safecall

Represents the field's value of data table specified by name as a integer value

function GetAsInteger(const FieldName: string): Integer

Parameters:

  • FieldName: name of data table's field

GetAsString (Integer): string  protected overload safecall

Represents the field's value of data table specified by index as a string value

function GetAsString(Index: Integer): string

Parameters:

  • Index: index of data table's field

GetAsString (string): string  protected overload safecall

Represents the field's value of data table specified by name as a string value

function GetAsString(const FieldName: string): string

Parameters:

  • FieldName: name of data table's field

GetAsVariant (Integer): Variant  protected overload safecall

Represents the field's value of data table specified by index as a variant value

function GetAsVariant(Index: Integer): Variant

Parameters:

  • Index: index of data table's field

GetAsVariant (string): Variant  protected overload safecall

Represents the field's value of data table specified by name as a variant value

function GetAsVariant(const FieldName: string): Variant

Parameters:

  • FieldName: name of data table's field

GetBOF  protected

Determines whether data table cursor reached the beginning of the dataset

function GetBOF: Boolean

GetBookmark

Allocates a bookmark for the active record in the dataset.

function GetBookmark: TBookmark

GetCloneSource

Returns data table that is a clone source for the current data table

function GetCloneSource: TDADataTable

GetDataset  protected safecall

Returns dataset of current data table

function GetDataset: TDataset

GetDatasetClass  protected virtual abstract

Returns class of data table's dataset.

function GetDatasetClass: TDatasetClass

GetDetailDataTables

Returns list of detail datasets for the current master data table

function GetDetailDataTables: TDADataTableList

GetDetailTablesforAllinOneFetch

Forms lists of detail tables (aSame and aOther) for current master data table for which dtIncludeInAllInOneFetch option is set (automatic downloading data for this detail table when filling the master)

procedure GetDetailTablesforAllinOneFetch(aSame: TDADataTableList; aOther: TDADataTableList; aRecursive: Boolean)

Parameters:

  • aSame: list of details tables for current master data table, that support RemoteFetchEnabled and filled frrom the same data adapter as master data table. Master table should support RemoteFetchEnabled also
  • aOther: details tables for current master data table that either don't support RemoteFetchEnabled or filled from another data adapter them master table
  • aRecursive: specifies that filling of aSame and aOther lists should performed recursively for multi-level master/detail

GetDetailTablesforApplyUpdate

Forms list of detail tables for current master table which should automatically apply detail changes to the server when ApplyUpdates is called on the master.

function GetDetailTablesforApplyUpdate(aRecursive: Boolean): TDADataTableList

Parameters:

  • aRecursive: specifies that filling of detail tables lists should performed recursively for multi-level master/detail

GetEOF  protected

Determines whether data table cursor reached the end of the dataset

function GetEOF: Boolean

GetFieldIndexes  protected safecall

Returns index of data table's field specified by name

function GetFieldIndexes(const aName: string): Integer

Parameters:

  • aName: name of data table's field

GetFieldNames  protected safecall

Returns name of data table's field specified by index

function GetFieldNames(Index: Integer): string

Parameters:

  • Index: index of data table's fieldIndex of the field

GetIsServer  protected

Implements GetIsServer method of IDAScriptContext interface- gets a flag indicating wherther the Script is being executed by a server application or not. For TDADataTable returns false

function GetIsServer: Boolean

Returns MasterLink

function GetMasterDataLink: TMasterDataLink

GetMasterDataTable

Returns data table that is a master for the current data table in Master/Detail relationship

function GetMasterDataTable: TDADataTable

GetName  protected safecall

Returns name of the data table - either LogicalName or Name of the TDADataTable instance (in the case if LogicalName is empty)

function GetName: string

GetNames  protected

Returns data table's field name specified by Index

function GetNames(Index: Integer): string

Parameters:

  • Index: index of data table field

GetOldValue (TField): Variant  protected overload

Contains the original value of a changed field.

function GetOldValue(aField: TField): Variant

Parameters:

  • aField: field

GetOldValue (Integer): Variant  protected overload

Contains the original value of a changed field.

function GetOldValue(aIndex: Integer): Variant

Parameters:

  • aIndex: field index

GetParams  protected safecall

Returns list of data table parameters

function GetParams: TDAParamCollection

GetRangeState  protected virtual

Indicates if range is set for the data table

function GetRangeState: Boolean

GetReadOnly  protected virtual

Indicates whether the data table is read-only (true) or not (false, default). If table is read-only, no changes to the data contained in the table will be permitted.

function GetReadOnly: Boolean

GetRecordCount  protected

Returns number of records in the data table

function GetRecordCount: Integer

GetSchema  protected

Returns schema of the database

function GetSchema: TDAClientSchema

GetSession  protected

Implements GetSession method of IDAScriptContext interface - gets current Session instance. For TDADataTable always gets nil as scripts being executed by a client application.

function GetSession: IDAScriptSession

GetSimpleCloneSource  protected

Returns data table that is a clone source for the current data table

function GetSimpleCloneSource: TObject

GetUsingClonedCursor

Indicates if CloneSource is assigned

function GetUsingClonedCursor: Boolean

GotoBookmark

Positions on the record to which a specified bookmark points.

procedure GotoBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: record identified by this Bookmark should be active

ImportDelta

Imports external delta.

procedure ImportDelta(aDelta: IDADelta)

Parameters:

  • aDelta: delta

Insert

Inserts a new record in the data table

procedure Insert

intDATypeToVCLType  protected virtual

Returns appropriate standart field type for DA field type. For example, ftString for datString

function intDATypeToVCLType(aDAType: TDADataType): TFieldType

Parameters:

  • aDAType: DA type of field

InterfaceSupportsErrorInfo  protected stdcall

Indicates whether an interface supports the IErrorInfo interface.

function InterfaceSupportsErrorInfo(const iid: TGUID): HResult

Parameters:

  • iid: GUID or name of interface that should be checked

IsCanEditCurrentRow

Indicates if the current record isn't locked by other tables.

function IsCanEditCurrentRow: Boolean

IsDeltaInitialized  protected safecall

Indicates if the data table has not nil Delta

function IsDeltaInitialized: Boolean

isPKDuplicateDetected  protected virtual

Checks before posting changes if primary key of edited record already exists in the data table

function isPKDuplicateDetected: Boolean

IsUserEventHandlersDisabled

Checks if event handlers were disabled by DisableUserEventHandlers method

function IsUserEventHandlersDisabled: Boolean

Last

Moves to the last record of the data table

procedure Last

LoadFromFile

Loads the content of the data table, including the Delta, from a local briefcase file.

procedure LoadFromFile(const aFileName: string)

Parameters:

  • aFileName: name of the file from where content of the data table should be loaded

LoadFromRemoteSource  virtual

Fills the data table with data from the server, using the RemoteDataAdapter. GetDataCall. If the MaxRecords property does not equal -1, the method loads the next MaxRecords records.

procedure LoadFromRemoteSource(BookmarkPosition: Boolean)

Parameters:

  • BookmarkPosition: indicates if cursor position should be saved before loading data and restore after that

LoadFromStream

Loads the content of the data table, including the Delta, from a stream.

procedure LoadFromStream(aStream: TStream)

Parameters:

  • aStream: stream from where data table is loaded

LoadSchema

Downloads the schema for the data table from the server, using the RemoteDataAdapter.GetSchemaCall and fills the Fields and Params collections based on the newly obtained schema information.

procedure LoadSchema(PreserveLookupFields: Boolean; PreserveClientCalcFields: Boolean)

Parameters:

  • PreserveLookupFields: indicates if Lookup Fields should be saved and added after schema was loaded from the server
  • PreserveClientCalcFields: indicates if Calculated Fields should be saved and added after schema was loaded from the server

LoadScript

Fills the ScriptCode property by downloading the appropriate script from the server, using the RemoteDataAdapter.GetScriptsCall. For business rules scripts to run, a ScriptingProvider must be assigned.

procedure LoadScript(aDatasetName: string)

Parameters:

  • aDatasetName: parameter is not used

Locate

Searches a dataset for a specified record and making it the active record.

function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean

Parameters:

  • KeyFields: identifies the field or fields (semicolon-separated list) in the dataset that must be matched in a lookup dataset when doing Locate
  • KeyValues: value or values of KeyFileds fields that are looked for in the data table
  • Options: indicates whether the search is case insensitive (loCaseInsensitive) and whether partial matches are supported (loPartialKey).

Lookup

Retrieves the field values from the record that matches the specified search values.

function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant

Parameters:

  • KeyFields: identifies the field or fields (semicolon-separated list) in the dataset that must be matched in a lookup dataset when doing a lookup.
  • KeyValues: Values specified by the Variant or Variant array.
  • ResultFields: semicolon-separated list of fields which values should be returned

MergeDelta  virtual

Merges the changes stored in the Delta into the base data of the data table and clears the delta. This persists the changes in the local data, but removes them from the Delta so they will not be (re-)applied to the server. You will not usually call this method directly, it is used internally by ApplyUpdates. Call this method if you want to explicitly prevent pending changes from being applied to the server, but keep them in the local data table. For example, after applying changes to the server, an application might delete records from the data table that are no longer needed locally to keep the memory footprint of the application small. After doing so, it would call MergeDelta to ensure these deletes will not be propagated to the server. (Alternatively, the application could also set LogChanges to false while performing the deletes.)

procedure MergeDelta

Moves to the next record in the data table, making it the active record.

procedure Next

Notification  protected override

Forwards notification messages to all owned components.

procedure Notification(AComponent: TComponent; Operation: TOperation)

Parameters:

  • AComponent: component
  • Operation: operation

NotifyFieldsClear  protected virtual

Notifies datasources about clearing fields when controls are disabled

procedure NotifyFieldsClear

OnMasterChange  protected virtual

Fires whenever current record of master data table is changed - either by moving to another record or by editing record. Fetches detail records for the changed master record.

procedure OnMasterChange(Sender: TObject)

Parameters:

  • Sender: indicates which component called the event handler

OnMasterDisable  protected virtual

Occurs when the source dataset becomes inactive. Currently not implemented.

procedure OnMasterDisable(Sender: TObject)

Parameters:

  • Sender: indicates which component called the event handler

Open

Opens the dataset and prepares it for fetching records from the database. If the dataset is not empty, the cursor will be placed on the first available record; otherwise, EOF will be set to true to indicate that the end of the (empty) record set has been reached.

procedure Open

ParamByName

Locates a specific parameter, based on its name. If no matching parameter is defined, an exception will be raised.

function ParamByName(const aName: string): TDAParam

Parameters:

  • aName: name of the parameter

Post

Saves changes in the data table

procedure Post

Prior

Moves to the previous record of the data table

procedure Prior

QueryInterface  protected override

Returns a reference to a specified interface if the object supports that interface. This is one of the methods introduced by the IUnknown interface.

function QueryInterface(const IID: TGUID; out Obj: ): HResult

Parameters:

  • IID: Identifier of the interface to return
  • Obj: nterface specified by IID

ReadDeltaFromStream (TDADataStreamer, TList<TDADeltaChange>)  overload

Reads the data table's delta from the streamer. If delta's change has csFailed status - add it to the list of failed deltas. Reads also deltas of detail tables for current master table which should automatically apply detail changes to the server.

procedure ReadDeltaFromStream(aStreamer: TDADataStreamer; aFailedDeltas: TList<TDADeltaChange>)

Parameters:

  • aStreamer: steamer that contains delta
  • aFailedDeltas: list of failed delta's changes

ReadDeltaFromStream (TDADataStreamer, Boolean, Boolean)  overload

procedure ReadDeltaFromStream(aStreamer: TDADataStreamer; aOnlyWithSameDataAdapter: Boolean; aRecursive: Boolean)

Parameters:

  • aStreamer:
  • aOnlyWithSameDataAdapter:
  • aRecursive:

Refresh

Re-fetches data from the database to update a dataset's view of data.

procedure Refresh

RefreshFromServer

Receive data from the database to update dataet's view of data. After receiving it compares existing records with received records and replaces changed records with new ones or inserts new ones

procedure RefreshFromServer

RefreshRow

Reloads current record from the database

procedure RefreshRow

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure ROFreeNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure RORemoveFreeNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

RowHelper_GetPreviousValues  protected

function RowHelper_GetPreviousValues(aName: Variant): Variant

Parameters:

  • aName:

RowHelper_GetTableName  protected

function RowHelper_GetTableName: string

RowHelper_SetCurrentValues  protected

procedure RowHelper_SetCurrentValues(aName: Variant; aValue: Variant)

Parameters:

  • aName:
  • aValue:

SafeCallException  override

Handles exceptions in methods that use safecall directive.

function SafeCallException(ExceptObject: TObject; ExceptAddr: Pointer): HResult

Parameters:

  • ExceptObject: Exception object.
  • ExceptAddr: Address of the exception.

SaveToFile

Saves the current content of the data table, including the Delta, to a local briefcase file.

procedure SaveToFile(const aFileName: string)

Parameters:

  • aFileName: name of the file where data table content should be saved to

SaveToStream

Saves the current content of the data table, including the Delta, to a stream.

procedure SaveToStream(aStream: TStream)

Parameters:

  • aStream: stream where data table should be saved to

SendRemoveNotification  protected    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure SendRemoveNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

Sort

Sorts the data table.

procedure Sort(const FieldNames: array of string; const Directions: array of TDASortDirection)

Parameters:

  • FieldNames: array of field names on which sorting should be done
  • Directions: array with sort directions (asceding or desceding) specified for every field from FieldNames array

UnSort

Unsorts the data table.

procedure UnSort

WriteDeltaToStream

Writes Deltas to stream via given streamer.

procedure WriteDeltaToStream(aStreamer: TDADataStreamer; aOnlyWithSameDataAdapter: Boolean; aRecursive: Boolean)

Parameters:

  • aStreamer: streamer
  • aOnlyWithSameDataAdapter: required mode
  • aRecursive:

 

OnAfterApplyUpdates

Fires right after the data table has finished applying updates to the server.

property OnAfterApplyUpdates: TDADataTableNotifyEvent read write
delegate: procedure OnAfterApplyUpdates(DataTable: TDADataTable)

OnAfterCancel

fires after changes are cancelled for data table

property OnAfterCancel: TDADataTableNotifyEvent read write
delegate: procedure OnAfterCancel(DataTable: TDADataTable)

OnAfterClose

fires after data table is closed

property OnAfterClose: TDADataTableNotifyEvent read write
delegate: procedure OnAfterClose(DataTable: TDADataTable)

OnAfterDataRequestCall

Fires right after the data table has finished a data request call to the server.

property OnAfterDataRequestCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnAfterDataRequestCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnAfterDataUpdateCall

Fires right after the data table has finished a data update call to the server.

property OnAfterDataUpdateCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnAfterDataUpdateCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnAfterDelete

fires after record was deleted from data table

property OnAfterDelete: TDADataTableNotifyEvent read write
delegate: procedure OnAfterDelete(DataTable: TDADataTable)

OnAfterEdit

fires after record was edited in data table

property OnAfterEdit: TDADataTableNotifyEvent read write
delegate: procedure OnAfterEdit(DataTable: TDADataTable)

OnAfterFieldChange

Fires right after a field was changed.

property OnAfterFieldChange: TDADataTableDataChangeEvent read write
delegate: procedure OnAfterFieldChange(DataTable: TDADataTable; Field: TDAField)

OnAfterInsert

fires after record was inserted in data table

property OnAfterInsert: TDADataTableNotifyEvent read write
delegate: procedure OnAfterInsert(DataTable: TDADataTable)

OnAfterMergeDelta

Fires right after the data table has finished merging deltas received from the server.

property OnAfterMergeDelta: TDADataTableNotifyEvent read write
delegate: procedure OnAfterMergeDelta(DataTable: TDADataTable)

OnAfterOpen

fires after data table was opened

property OnAfterOpen: TDADataTableNotifyEvent read write
delegate: procedure OnAfterOpen(DataTable: TDADataTable)

OnAfterPost

fires after record was posted in data table

property OnAfterPost: TDADataTableNotifyEvent read write
delegate: procedure OnAfterPost(DataTable: TDADataTable)

OnAfterRefresh

fires after data table was refreshed

property OnAfterRefresh: TDADataTableNotifyEvent read write
delegate: procedure OnAfterRefresh(DataTable: TDADataTable)

OnAfterSchemaCall

Fires after schema was loaded for the data table

property OnAfterSchemaCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnAfterSchemaCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnAfterScriptCall

Fires right after the data table has finished a script call to the server.

property OnAfterScriptCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnAfterScriptCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnAfterScroll

fires after current record was changed in data table

property OnAfterScroll: TDADataTableNotifyEvent read write
delegate: procedure OnAfterScroll(DataTable: TDADataTable)

OnBeforeApplyUpdates

Fires just before the data table starts applying updates to the server.

property OnBeforeApplyUpdates: TDABeforeApplyUpdatesEvent read write
delegate: procedure OnBeforeApplyUpdates(DataTable: TDADataTable; const Delta: IDADelta)

OnBeforeCancel

fires before changes in data table are cancelled

property OnBeforeCancel: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeCancel(DataTable: TDADataTable)

OnBeforeClose

fires before data table is closed

property OnBeforeClose: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeClose(DataTable: TDADataTable)

OnBeforeDataRequestCall

Fires just before the data table starts a data request call to the server.

property OnBeforeDataRequestCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnBeforeDataRequestCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnBeforeDataUpdateCall

Fires just before the data table starts a data update call to the server.

property OnBeforeDataUpdateCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnBeforeDataUpdateCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnBeforeDelete

fires before record in data table is deleted

property OnBeforeDelete: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeDelete(DataTable: TDADataTable)

OnBeforeEdit

fires before record is edited in data table

property OnBeforeEdit: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeEdit(DataTable: TDADataTable)

OnBeforeFieldChange

Fires just before field will be changed during the update process

property OnBeforeFieldChange: TDADataTableDataChangeEvent read write
delegate: procedure OnBeforeFieldChange(DataTable: TDADataTable; Field: TDAField)

OnBeforeInsert

fires before record is inserted in data table

property OnBeforeInsert: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeInsert(DataTable: TDADataTable)

OnBeforeMergeDelta

Fires just before delta is merged

property OnBeforeMergeDelta: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeMergeDelta(DataTable: TDADataTable)

OnBeforeOpen

fires before data table is opened

property OnBeforeOpen: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeOpen(DataTable: TDADataTable)

OnBeforePost

fires before record is posted in data table

property OnBeforePost: TDADataTableNotifyEvent read write
delegate: procedure OnBeforePost(DataTable: TDADataTable)

OnBeforeRefresh

fires before data table is refreshed

property OnBeforeRefresh: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeRefresh(DataTable: TDADataTable)

OnBeforeSchemaCall

Fires before schema will be loaded for the data table

property OnBeforeSchemaCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnBeforeSchemaCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnBeforeScriptCall

Fires just before the data table starts a script call to the server.

property OnBeforeScriptCall: TDADataTableRemoteRequestEvent read write
delegate: procedure OnBeforeScriptCall(DataTable: TDADataTable; Request: TDARemoteRequest)

OnBeforeScroll

fires before current record is changed in data table

property OnBeforeScroll: TDADataTableNotifyEvent read write
delegate: procedure OnBeforeScroll(DataTable: TDADataTable)

OnCalcFields

Fires when calculated field need to be recalculated

property OnCalcFields: TDADataTableNotifyEvent read write
delegate: procedure OnCalcFields(DataTable: TDADataTable)

OnDeleteError

Fires whenever error is ocured when doing Delete

property OnDeleteError: TDADataTableErrorEvent read write
delegate: procedure OnDeleteError(DataTable: TDADataTable; Error: EDatabaseError; var Action: TDataAction)

OnEditError

Fires wheneve error is ocured when doing Edit

property OnEditError: TDADataTableErrorEvent read write
delegate: procedure OnEditError(DataTable: TDADataTable; Error: EDatabaseError; var Action: TDataAction)

OnFilterRecord

Fires when data is loaded into the data table and filtering is active for the data table

property OnFilterRecord: TDADataTableFilterEvent read write
delegate: procedure OnFilterRecord(DataTable: TDADataTable; var Accept: Boolean)

OnMergeDeltaUnknownChange

Fires if key field names contain values that couldn't be found in the data table

property OnMergeDeltaUnknownChange: TDAMergeDeltaUnknownChangeEvent read write
delegate: procedure OnMergeDeltaUnknownChange(DataTable: TDADataTable; const Delta: IDADelta; const Change: TDADeltaChange)

OnNewRecord

Fires whenever a new record is added to the data table

property OnNewRecord: TDADataTableNotifyEvent read write
delegate: procedure OnNewRecord(DataTable: TDADataTable)

OnPostError

Fires whenever error is ocured when doing Post

property OnPostError: TDADataTableErrorEvent read write
delegate: procedure OnPostError(DataTable: TDADataTable; Error: EDatabaseError; var Action: TDataAction)

OnReceiveDataStream

Fires when data is loaded into the data table from a LocalSchema

property OnReceiveDataStream: TDADataRequestStreamEvent read write
delegate: procedure OnReceiveDataStream(DataTable: TDADataTable; Stream: TStream)

OnScriptError

Fires whenever error is ocured during script execution initiated by CallScript operation

property OnScriptError: TDAScriptErrorNotifyEvent read write
delegate: procedure OnScriptError(DataTable: TDADataTable; E: EDAScriptError; var raiseException: Boolean)