ZEOS Database Objects
Interbase SQL Components

Contents


TZIbSQLDatabase

Properties | Methods | Events

Component for connections to the Interbase SQL database server. The dynamic load library gds32.dll is necessary.

Hierarchy: TObject->TPersistent->TComponent->TZDatabase->TZIbSQLDatabase

TZIbSQLDatabase properties
Handle:TDirConnect Descriptor of direct connection to the database
Host:ShortString Interbase SQL database server host name
Database:ShortString Database name
Login:ShortString User name for connection
Password:ShortString Password for connection to the database
LoginPromt:Boolean When the value is switched to true, window for entering user name and password appears.
Port:ShortString Port number for connection to Interbase SQL server
Connected:Boolean Indicates the connection to database. When the value is switched to true, connection to the database occurs. Method Connect does the same.
SqlDialect:Word Determines the version of the SQL dialect. Value 1 corresponds to the versions SQL 4.0, 5.0, 5.5. Value 3 - new SQL syntax a version 6.0.
Params:TStrings Specifies the additional parameters for connection to a database. See documentation of Interbase for more.

Back | Contents

TZIbSQLDatabase methods
procedure Connect() Connects to the database
procedure Disconnect() Disconnects from the database

Back | Contents

TZIbSQLDatabase events
procedure AfterConnect(Sender:TObject) Occurs after an application completes connecting to a database
procedure AfterDisconnect(Sender:TObject) Occurs after an application completes disconnecting from a database
procedure BeforeConnect(Sender:TObject) Occurs before an application completes connecting to a database
procedure BeforeDisconnect(Sender:TObject) Occurs before an application completes disconnecting from a database

Back | Contents

TZIbSQLMonitor

Events

Component for the tracing of an outgoing queries. It have the one event, which occurs when any SQL queries is processed by Interbase SQL server. It returns the outgoing query and its result.

Hierarchy: TObject->TPersistent->TComponent->TZMonitor->TZIbSQLMonitor

TZIbSQLMonitor events
procedure MonitorEvent(Sql, Result: String) Event occurs when Interbase SQL server have processed the query. The returning values:
  • Sql - text of the outgoing query
  • Result - the result, which includes errors and time of processing.

Back | Contents

TZIbSQLQuery

Properties | Methods | Events

Component for perfoming SQL queries to Interbase SQL server. It's used for sending SQL statements to Interbase SQL server. пересылки выражений SQL запросов Interbase SQL серверу. The results of processing is available to use with the standart TDataSource. The records can be added, deleted or changed.

Hierarchy: TObject->TPersistenet->TComponent->TDataSet->TZDataSet-> TZCustomInterbase SQLDataSet->TZIbSQLQuery

TZIbSQLQuery properties
Active:Boolean Indicates the query is opened. When the value is switched to true, query will be opened. For query like 'SELECT' only.
AutoCalcFields:Boolean Determines when the OnCalcFields event is triggered.
CachedUpdates:Boolean Specifies whether cached updates are enabled
DataBase:TZIbSQLDatabase Identifies the database component
DataSource:TDataSource Identifies DataSource for access
ExtraOptions:TInterbase SQLOptions The set of the special options:
  • moStoreResult - indicates the method for using the query. If value is switched to true(default), then the result of the query completely transmitts to a client and the connection to database is free for other queries. Otherwise, the connection to the database is blocked till end of processing of the query. In this case less memory is needed.
  • moUseGen - determines using of generators
Filter:ShortString Specifies the text of the current filter for a dataset.
Filtered:Boolean Specifies whether filtering is active for a dataset.
FilterOptions:TFilterOptions Specifies filters is:
  • foCaseInsensitive - whether filtering is case insensitive
  • foNoPartialCompare - whether or not partial comparisons are permitted when filtering records
LinkFields The Wizard of relationships of queries
LinkOptions:TZLinkOptions The set of options for linking fileds
  • loLinkRequery - determines wheter or not link reguery
  • loCascadeUpdate - determines cascade renovation of data
  • loCascadeDelete - determines cascade removing
  • loAlwaysResync - determines sinchronization
MasterSource:TDataSource Indicates the master DataSource for linking of fields
Options:TZDatabaseOptions Extended options
  • doParamAsIs - determines processing parameters in their primary representation
  • doHourGlass - determines whether or not to display a sand clock while query is processing
  • doQueryAllRecords - determines to process all records
  • doCheckNulls - determines check nulls values
  • doCalcDefault - determines calculation by default
ParamCount:Word Indicates the current number of parameters for the query.
Params:TParams Contains the parameters for a query's SQL statement.
ParamCheck:Boolean Specifies whether the parameter list for a query is regenerated
RequestLive:Boolean Specifies whether or not a query result is read-only
RecordCount:LongInt Indicates the total number of records associated with the dataset.
ShowRecordTypes The parameters of records, which determines to show:
  • rtModified - all modified records
  • rtInserted - all added records
  • rtDeleted - all deleted records
  • rtUnmodified - all unmodified records
Sql:TStringList Contains the text of the SQL statement to execute for the query
Transaction:TZIbSQLTransact Indicates Transact component
UpdateObject:TZUpdateSQL Specifies the update object component used to update a read-only result set when cached updates are enabled.

Back | Contents

TZIbSQLQuery methods
procedure ExecSql; Executes the SQL statement for the query. Use ExecSQL to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, and CREATE TABLE).
function RowsAffected: LongInt; Returns the number of rows operated upon by the latest query execution.
procedure SortInverse; Inverts rules for sorting of the records
procedure SortClear; Removes rules for sorting of the records
procedure SortByField(FieldName: string); Sorts all record by field
procedure SortDescByField(FieldName: string); Sorts all record by field descanding
function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean; Searches the dataset for a specified record and makes that record the current record. Options is a set that optionally specifies additional search latitude when searching on string fields.
  • loCaseInsensitive - Key fields and key values are matched without regard to case
  • loPartialKey - Key values can include only part of the matching key field value
Returns True if it finds a matching record,
function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant; Retrieves field values from a record that matches specified search values, like Locate.
function IsSequenced: Boolean; Indicates whether sequence numbers are available for database records.
procedure ApplyUpdates; Writes a dataset's pending cached updates to the database
procedure CommitUpdates; Clears the cached updates buffer.
procedure CancelUpdates; Clears all pending cached updates from the cache and restores the dataset its prior state.
procedure RevertRecord; Restores the current record in the dataset to an unmodified state when cached updates are enabled.
function ParamByName(const Value: string): TParam; Accesses parameter information based on a specified parameter name.
function CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; Provides the interface for a method that creates a blob stream for a Binary large object (BLOB) field in the dataset.
  • bmRead - The stream is used to read from a BLOB field.
  • bmWrite - The stream is used to write to a BLOB field.
  • bwReadWrite - The stream is used to modify a BLOB field's value.
procedure SaveToStream(Stream: TStream); Saves the contents of a Dataset to a stream.
procedure LoadFromStream(Stream: TStream); Loads a stream into the Dataset.
procedure SaveToFile(FileName: string); Saves a dataset's data to an external file.
procedure LoadFromFile(FileName: string); Loads a dataset's data from a file.

Back | Contents

TZIbSQLQuery events
procedure AfterCancel(DataSet: TDataSet); Occurs after an application completes a request to cancel modifications to the current record.
procedure AfterClose(DataSet: TDataSet); Occurs after an application closes a dataset.
procedure AfterDelete(DataSet: TDataSet); Occurs after an application deletes a record.
procedure AfterEdit(DataSet: TDataSet); Occurs after an application deletes a record.
procedure AfterInsert(DataSet: TDataSet); Occurs after an application inserts a new record.
procedure AfterOpen(DataSet: TDataSet); Occurs after an application completes opening a dataset and before any data access occurs.
procedure AfterPost(DataSet: TDataSet); Occurs after an application writes the current record to the database or cache and before the dataset is returned to browse state.
procedure AfterScroll(DataSet: TDataSet); Occurs after an application scrolls from one record to another.
procedure BeforeCancel(DataSet: TDataSet); Occurs before an application executes a request to cancel changes to the current record.
procedure BeforeClose(DataSet: TDataSet); Occurs before an application executes a request to close the dataset.
procedure BeforeDelete(DataSet: TDataSet); Occurs before an application attempts to delete the current record.
procedure BeforeEdit(DataSet: TDataSet); Occurs before an application enters edit mode for the current record.
procedure BeforeInsert(DataSet: TDataSet); Occurs before an application enters insert mode.
procedure BeforeOpen(DataSet: TDataSet); Occurs before an application executes a request to open a dataset.
procedure BeforePost(DataSet: TDataSet); Occurs before an application posts changes for the current record to the database or cache.
procedure BeforeScroll(DataSet: TDataSet); Occurs before an application scrolls from one record to another.
procedure ApplyUpdateError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); Occurs if an exception is generated when cached updates are applied to a database.
procedure CalcFields(DataSet: TDataSet); Occurs when an application recalculates calculated fields.
procedure DeleteError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); Occurs when an application attempts to delete a record and an exception is raised.
procedure EditError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); Occurs when an application attempts to modify or insert a record and an exception is raised.
procedure FilterRecord(DataSet: TDataSet;var Accept: Boolean); Occurs each time a different record in the dataset becomes the current record and filtering is enabled.
procedure NewRecord(DataSet: TDataSet); Occurs when an application inserts or appends a new dataset record.
procedure PostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); Occurs when an application attempts to modify or insert a record and an exception is raised.
procedure UpdateRecord(DataSet: TDataSet; UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); Occurs if an exception is generated when cached updates are applied to a database.

Back | Contents


TZIbSQLTable

Component for processing the results of the query to Interbase SQL server in the manner of table.

Hierarchy: TObject->TPersistenet->TComponent->TDataSet->TZDataSet-> TZCustomInterbase SQLDataSet->TZIbSQLTable

Hasn't any principle differences from TZIbSQLQuery, but the following exclusions:

Back | Contents

TZIbSQLTransact

Properties | Methods | Events

Component for work with transactions of Interbase SQL server

Hierarchy: TObject->TPersistent->TComponent->TZTransact->TZIbSQLTransact
TZIbSQLTransact properties
AutoCommit:Boolean If of the value of this property is switched to true then updates will be apllied automatically. Otherwise is necessary to call Commit or Rollback manually.
Connected:Boolean Indicates the connection to a database
Database:TZIbSQLDatabase Specifies a database component
Options:TZTransactOptions The set of options:
  • toHourGlass - determines to display a sand clock while transactions is procesing
Params:TStrings Specifies the additional parameters for connection to the server See documentation of Interbase for more.

Back | Contents

TZIbSQLTransact methods
procedure Connect Connects to Interbase SQL server
procedure Disconnect Disconnects from Interbase SQL server
procedure Commit Updates all changes in the transaction buffer and its clear
procedure RollBack Rollback of transactions
procedure DoApplyUpdates Updates all changes from the transaction buffer

Back | Contents

TZIbSQLTransact events
procedure OnApplyUpdates(Sender:TObject) Occurs when an application applies all changes from the transaction buffer
procedure OnCommit(Sender:TObject) Occurs when an application calls Commit method
procedure OnDataChange(Sender:TObject) Occurs when contents of the database is changed
procedure OnRollBack(Sender:TObject) Occurs when an apllication calls Rollback method

Back | Contents