IDAEditableDataset

Overview

IDAEditableDataset contains methods for the editing of datasets. It is also used inside certain protected methods to read the dataset from a stream.

This example demonstrates how to use this interface:

var
  editable:IDAEditableDataset;
begin
  editable := tbl_Customers as IDAEditableDataset;
  editable.Open();
  //...................
end;

Location


 

Active    (declared in IDADataset)

Specifies 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  safecall

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  safecall

Adds a new, empty record to the end of the dataset. The newly appended record becomes the active record. After calling Append, the application can enable users to enter data in the fields of the record and can post these changes using Post.

procedure Append

BookmarkValid  safecall    (declared in IDADatasetEx)

Returns True if bookmarked record exists

function BookmarkValid(Bookmark: TBookmark): Boolean

Parameters:

  • Bookmark: bookmark that is checked

Cancel  safecall

Cancels the current operation and puts the dataset into dsBrowse state.

procedure Cancel

Close  safecall    (declared in IDADataset)

Closes the dataset

procedure Close

ControlsDisabled  safecall    (declared in IDADataset)

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

function ControlsDisabled: Boolean

CurrentRecIdValue    (declared in IDADataset)

Returns identificator of current record.

property CurrentRecIdValue: Integer read write

Dataset    (declared in IDADataset)

Access to the standard VCL TDataSet

property Dataset: TDataSet read

Delete  safecall

Deletes current record in dataset

procedure Delete

DisableConstraints  safecall    (declared in IDADataset)

Disables dataset constraints

procedure DisableConstraints

DisableControls  safecall    (declared in IDADataset)

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

procedure DisableControls

DisableEventHandlers  safecall

Detaches all internal events from the Dataset object.

procedure DisableEventHandlers

DynamicWhere    (declared in IDADataset)

Implementation of Dynamic Where.

property DynamicWhere: TDAWhereBuilder read write

Edit  safecall

Enables editing of data in the dataset.

procedure Edit

EnableConstraints  safecall    (declared in IDADataset)

Enables dataset constraints

procedure EnableConstraints

EnableControls  safecall    (declared in IDADataset)

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

procedure EnableControls

EnableEventHandlers  safecall

Attaches all internal events to the Dataset object.

procedure EnableEventHandlers

Eof    (declared in IDADataset)

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

FieldByName  safecall    (declared in IDADataset)

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    (declared in IDADataset)

Indicates the number of fields contained in the dataset.

property FieldCount: Integer read

Fields    (declared in IDADataset)

Provides access to all the fields contained in the dataset.

property Fields: TDAFieldCollection read

FieldValues    (declared in IDADataset)

Provides 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

FindField  safecall    (declared in IDADataset)

Returns an item with the specified name.

function FindField(const aName: string): TDAField

Parameters:

  • aName: name of the searched field

First  safecall

Moves to the first record of the dataset

procedure First

FreeBookmark  safecall    (declared in IDADatasetEx)

Frees the resources allocated for a specified bookmark.

procedure FreeBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: bookmark that should be freed

GetBOF  safecall    (declared in IDADatasetEx)

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

function GetBOF: Boolean

GetBookMark  safecall    (declared in IDADatasetEx)

Allocates a bookmark for the active record

function GetBookMark: TBookmark

GetState  safecall    (declared in IDADatasetEx)

Indicates the current operating mode

function GetState: TDatasetState

GotoBookmark  safecall    (declared in IDADatasetEx)

Positions on the record to which a specified bookmark points.

procedure GotoBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: record identified by this Bookmark should be active

Insert  safecall

Inserts a new record

procedure Insert

IsEmpty    (declared in IDADataset)

Indicates whether the dataset contains no records.

property IsEmpty: Boolean read

Last  safecall

Moves to the last record in the dataset.

procedure Last

Locate  safecall    (declared in IDADataset)

Locates and activates a record by key values.

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

Parameters:

  • KeyFields: The semicolon-separated list of fields.
  • KeyValues: Values specified by the Variant or Variant array.
  • Options: Indicates whether the search is case insensitive and whether partial matches are supported.

LogicalName    (declared in IDADataset)

Defines the name of the data table.

property LogicalName: string read write

Lookup  safecall    (declared in IDADataset)

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: the semicolon-separated list of fields
  • KeyValues: Values specified by the Variant or Variant array.
  • ResultFields: The semicolon-separated list of result fields.

Name    (declared in IDADataset)

Returns a human-readable name for the command. For commands obtained through a TDASchema component, this will be the name that the command (or data table) was defined under in Schema Modeler. When obtaining a command from an IDAConnection, the name can be specified in the call to NewCommand or NewDataset.

property Name: string read

Names    (declared in IDADataset)

Returns data table's field name specified by Index

property Names[Index: Integer]: string read

Advances the cursor to the next available record in the dataset. If the current record is the last record available, calling Next will set EOF to indicate the end of the dataset has been reached.

procedure Next

OnAfterOpen    (declared in IDADataset)

Fires after dataset was opened

property OnAfterOpen: TDAAfterOpenDatasetEvent read write
delegate: procedure OnAfterOpen(const Sender: IDADataset; ActualSQL: string; ElapsedMilliseconds: Cardinal)

OnBeforeOpen    (declared in IDADataset)

Fires before dataset was opened

property OnBeforeOpen: TDABeforeOpenDatasetEvent read write
delegate: procedure OnBeforeOpen(const Sender: IDADataset)

Open  safecall    (declared in IDADataset)

Opens the dataset and prepares it for fetching records from the database.

procedure Open

ParamByName  safecall    (declared in IDADataset)

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    (declared in IDADataset)

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

property Params: TDAParamCollection read

Post  safecall

Saves changes in the dataset

procedure Post

Prior  safecall

Moves to the previous record of the dataset

procedure Prior

RecordCount    (declared in IDADataset)

Returns the counf of records

property RecordCount: Integer read

Refresh  safecall    (declared in IDADatasetEx)

Reopens the dataset.

procedure Refresh

RowRecIdValue    (declared in IDADataset)

Returns record ID

property RowRecIdValue: Integer read

State    (declared in IDADatasetEx)

Determines the current operating mode of the dataset. The state property determines which operations can be performed with the data in the dataset, such as editing existing records or inserting new ones. The dataset state constantly changes as the application processes data.

property State: TDatasetState read

 

Active    (declared in IDADataset)

Specifies 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

CurrentRecIdValue    (declared in IDADataset)

Returns identificator of current record.

property CurrentRecIdValue: Integer read write

Dataset    (declared in IDADataset)

Access to the standard VCL TDataSet

property Dataset: TDataSet read

DynamicWhere    (declared in IDADataset)

Implementation of Dynamic Where.

property DynamicWhere: TDAWhereBuilder read write

Eof    (declared in IDADataset)

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

FieldCount    (declared in IDADataset)

Indicates the number of fields contained in the dataset.

property FieldCount: Integer read

Fields    (declared in IDADataset)

Provides access to all the fields contained in the dataset.

property Fields: TDAFieldCollection read

FieldValues    (declared in IDADataset)

Provides 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

IsEmpty    (declared in IDADataset)

Indicates whether the dataset contains no records.

property IsEmpty: Boolean read

LogicalName    (declared in IDADataset)

Defines the name of the data table.

property LogicalName: string read write

Name    (declared in IDADataset)

Returns a human-readable name for the command. For commands obtained through a TDASchema component, this will be the name that the command (or data table) was defined under in Schema Modeler. When obtaining a command from an IDAConnection, the name can be specified in the call to NewCommand or NewDataset.

property Name: string read

Names    (declared in IDADataset)

Returns data table's field name specified by Index

property Names[Index: Integer]: string read

Params    (declared in IDADataset)

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

property Params: TDAParamCollection read

RecordCount    (declared in IDADataset)

Returns the counf of records

property RecordCount: Integer read

RowRecIdValue    (declared in IDADataset)

Returns record ID

property RowRecIdValue: Integer read

State    (declared in IDADatasetEx)

Determines the current operating mode of the dataset. The state property determines which operations can be performed with the data in the dataset, such as editing existing records or inserting new ones. The dataset state constantly changes as the application processes data.

property State: TDatasetState read

 

AddRecord  safecall

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  safecall

Adds a new, empty record to the end of the dataset. The newly appended record becomes the active record. After calling Append, the application can enable users to enter data in the fields of the record and can post these changes using Post.

procedure Append

BookmarkValid  safecall    (declared in IDADatasetEx)

Returns True if bookmarked record exists

function BookmarkValid(Bookmark: TBookmark): Boolean

Parameters:

  • Bookmark: bookmark that is checked

Cancel  safecall

Cancels the current operation and puts the dataset into dsBrowse state.

procedure Cancel

Close  safecall    (declared in IDADataset)

Closes the dataset

procedure Close

ControlsDisabled  safecall    (declared in IDADataset)

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

function ControlsDisabled: Boolean

Delete  safecall

Deletes current record in dataset

procedure Delete

DisableConstraints  safecall    (declared in IDADataset)

Disables dataset constraints

procedure DisableConstraints

DisableControls  safecall    (declared in IDADataset)

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

procedure DisableControls

DisableEventHandlers  safecall

Detaches all internal events from the Dataset object.

procedure DisableEventHandlers

Edit  safecall

Enables editing of data in the dataset.

procedure Edit

EnableConstraints  safecall    (declared in IDADataset)

Enables dataset constraints

procedure EnableConstraints

EnableControls  safecall    (declared in IDADataset)

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

procedure EnableControls

EnableEventHandlers  safecall

Attaches all internal events to the Dataset object.

procedure EnableEventHandlers

FieldByName  safecall    (declared in IDADataset)

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  safecall    (declared in IDADataset)

Returns an item with the specified name.

function FindField(const aName: string): TDAField

Parameters:

  • aName: name of the searched field

First  safecall

Moves to the first record of the dataset

procedure First

FreeBookmark  safecall    (declared in IDADatasetEx)

Frees the resources allocated for a specified bookmark.

procedure FreeBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: bookmark that should be freed

GetBOF  safecall    (declared in IDADatasetEx)

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

function GetBOF: Boolean

GetBookMark  safecall    (declared in IDADatasetEx)

Allocates a bookmark for the active record

function GetBookMark: TBookmark

GetState  safecall    (declared in IDADatasetEx)

Indicates the current operating mode

function GetState: TDatasetState

GotoBookmark  safecall    (declared in IDADatasetEx)

Positions on the record to which a specified bookmark points.

procedure GotoBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: record identified by this Bookmark should be active

Insert  safecall

Inserts a new record

procedure Insert

Last  safecall

Moves to the last record in the dataset.

procedure Last

Locate  safecall    (declared in IDADataset)

Locates and activates a record by key values.

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

Parameters:

  • KeyFields: The semicolon-separated list of fields.
  • KeyValues: Values specified by the Variant or Variant array.
  • Options: Indicates whether the search is case insensitive and whether partial matches are supported.

Lookup  safecall    (declared in IDADataset)

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: the semicolon-separated list of fields
  • KeyValues: Values specified by the Variant or Variant array.
  • ResultFields: The semicolon-separated list of result fields.

Advances the cursor to the next available record in the dataset. If the current record is the last record available, calling Next will set EOF to indicate the end of the dataset has been reached.

procedure Next

Open  safecall    (declared in IDADataset)

Opens the dataset and prepares it for fetching records from the database.

procedure Open

ParamByName  safecall    (declared in IDADataset)

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  safecall

Saves changes in the dataset

procedure Post

Prior  safecall

Moves to the previous record of the dataset

procedure Prior

Refresh  safecall    (declared in IDADatasetEx)

Reopens the dataset.

procedure Refresh

 

OnAfterOpen    (declared in IDADataset)

Fires after dataset was opened

property OnAfterOpen: TDAAfterOpenDatasetEvent read write
delegate: procedure OnAfterOpen(const Sender: IDADataset; ActualSQL: string; ElapsedMilliseconds: Cardinal)

OnBeforeOpen    (declared in IDADataset)

Fires before dataset was opened

property OnBeforeOpen: TDABeforeOpenDatasetEvent read write
delegate: procedure OnBeforeOpen(const Sender: IDADataset)