IDANativeDatabaseAccess

Overview

The IDANativeDatabaseAccess interface is used by the TDAEDataset (ancestor of dataset for any particular database) to implement dataset actions. A default implementation of this interface exists for TDataSet compatible drivers. You need to implement this interface if you want to implement a Data Abstract driver based on a non-TDataSet compatible native driver.

Location


 

Active

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

CanUseNativeFieldData

Specifies that given field can return data in GetNativeFieldData method

function CanUseNativeFieldData(Index: Integer): Boolean

Parameters:

  • Index: Required field index

ClearFieldDefs

Clears field definitions

procedure ClearFieldDefs

ControlsDisabled

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

function ControlsDisabled: Boolean

DisableControls

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

procedure DisableControls

EnableControls

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

procedure EnableControls

FieldCount

Indicates the number of fields contained in the dataset.

function FieldCount: Integer

FindField

Returns an item with the specified name.

function FindField(const FieldName: string): IDANativeField

Parameters:

  • FieldName: name of the searched field

FreeBookmark

Frees the resources allocated for a specified bookmark.

procedure FreeBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: bookmark that should be freed

GetBOF

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

Allocates a bookmark for the active record

function GetBookMark: Pointer

GetEOF

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).

function GetEOF: Boolean

GetFieldName

Returns the field name assosiated with the field index.

function GetFieldName(Index: Integer): string

Parameters:

  • Index: Index of the field

GetFields

Provides access to all the fields contained in the dataset.

function GetFields(Index: Integer): IDANativeField

Parameters:

  • Index: index

GetIsEmpty

Indicates whether the dataset contains no records.

function GetIsEmpty: Boolean

GetNativeFieldData

Sets the DataSize to the according field size value, allocates the Data memory and copies the content of the field.

function GetNativeFieldData(Index: Integer; var Buffer: TBytes): Boolean

Parameters:

  • Index: Required field index
  • Buffer: Buffer

GetNativeFieldDataType

Returns the field type of the Index field

function GetNativeFieldDataType(Index: Integer): TFieldType

Parameters:

  • Index: field index

GetNativeFieldValue

Returns the value of the Index field as Variant.

function GetNativeFieldValue(Index: Integer): Variant

Parameters:

  • Index: field index

GetRecordCount

Returns the counf of records

function GetRecordCount: Integer

GetState

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.

function GetState: TDatasetState

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

IsTDatasetCompatible

Returns True if TDataset-compatible driver is used.

function IsTDatasetCompatible: Boolean

Locate

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

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

Prepare

Specifies whether the SQL statement has been prepared for execution on the database (true) or not (false). Setting this property to true will automatically prepare the statement. Preparing statements on the database server allows for faster execution, especially if the statement will be executed multiple times, as the server will not need to re-parse the SQL text for every execution. Please refer to your database system documentation for more information on preparing statements. Note that changing the SQL or Where properties will automatically un-prepare the statement.

procedure Prepare(const AValue: Boolean)

Parameters:

  • AValue: state

 

Active

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

 

CanUseNativeFieldData

Specifies that given field can return data in GetNativeFieldData method

function CanUseNativeFieldData(Index: Integer): Boolean

Parameters:

  • Index: Required field index

ClearFieldDefs

Clears field definitions

procedure ClearFieldDefs

ControlsDisabled

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

function ControlsDisabled: Boolean

DisableControls

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

procedure DisableControls

EnableControls

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

procedure EnableControls

FieldCount

Indicates the number of fields contained in the dataset.

function FieldCount: Integer

FindField

Returns an item with the specified name.

function FindField(const FieldName: string): IDANativeField

Parameters:

  • FieldName: name of the searched field

FreeBookmark

Frees the resources allocated for a specified bookmark.

procedure FreeBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: bookmark that should be freed

GetBOF

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

Allocates a bookmark for the active record

function GetBookMark: Pointer

GetEOF

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).

function GetEOF: Boolean

GetFieldName

Returns the field name assosiated with the field index.

function GetFieldName(Index: Integer): string

Parameters:

  • Index: Index of the field

GetFields

Provides access to all the fields contained in the dataset.

function GetFields(Index: Integer): IDANativeField

Parameters:

  • Index: index

GetIsEmpty

Indicates whether the dataset contains no records.

function GetIsEmpty: Boolean

GetNativeFieldData

Sets the DataSize to the according field size value, allocates the Data memory and copies the content of the field.

function GetNativeFieldData(Index: Integer; var Buffer: TBytes): Boolean

Parameters:

  • Index: Required field index
  • Buffer: Buffer

GetNativeFieldDataType

Returns the field type of the Index field

function GetNativeFieldDataType(Index: Integer): TFieldType

Parameters:

  • Index: field index

GetNativeFieldValue

Returns the value of the Index field as Variant.

function GetNativeFieldValue(Index: Integer): Variant

Parameters:

  • Index: field index

GetRecordCount

Returns the counf of records

function GetRecordCount: Integer

GetState

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.

function GetState: TDatasetState

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

IsTDatasetCompatible

Returns True if TDataset-compatible driver is used.

function IsTDatasetCompatible: Boolean

Locate

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

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

Prepare

Specifies whether the SQL statement has been prepared for execution on the database (true) or not (false). Setting this property to true will automatically prepare the statement. Preparing statements on the database server allows for faster execution, especially if the statement will be executed multiple times, as the server will not need to re-parse the SQL text for every execution. Please refer to your database system documentation for more information on preparing statements. Note that changing the SQL or Where properties will automatically un-prepare the statement.

procedure Prepare(const AValue: Boolean)

Parameters:

  • AValue: state