Firebird/Interbase database connection unit Default Interbase/Firebird dialect Default dialect that will be used when connecting to databases. See for more details on dialects. Firebird/Interbase database error Firebird/Interbase database error, a descendant of . Firebird/Interbase GDS error code. Firebird/Interbase-specific error code, the GDS error code. From a Firebird perspective: Firebird throws 2 error codes for an exception. The high-level one is the SQLCODE, which is a negative 3-digit code. The lower-level one is the ISC code (or GDSCODE) which has 9 digits. Related ISC error types are grouped under the same SQLCODE. In some cases, each successive gdscode error gives you further information about the error condition. Note: SQLCODE is a deprecated SQL standard; its successor is SQLSTATE. Firebird/Interbase cursor A cursor that keeps track of where you are in a Firebird/Interbase dataset. It is a descendent of . Firebird/Interbase transaction Firebird/Interbase database transaction object. Descendant of . TIBConnection: Firebird/Interbase specific

TIBConnection is a descendant of and represents a connection to a Firebird/Interbase server.

It is designed to work with Interbase 6, Firebird 1 and newer database servers.

TIBConnection by default requires the Firebird/Interbase client library (e.g. gds32.dll, libfbclient.so, fbclient.dll,fbembed.dll) and its dependencies to be installed on the system. The bitness between library and your application must match: e.g. use 32 bit fbclient when developing a 32 bit application on 64 bit Linux.

On Windows, in accordance with the regular Windows way of loading DLLs, the library can also be in the executable directory. In fact, this directory is searched first, and might be a good option for distributing software to end users as it eliminates problems with incompatible DLL versions.

TIBConnection is based on FPC Interbase/Firebird code (ibase60.inc) that tries to load the client library. If you want to use Firebird embedded, make sure the embedded library is searched/loaded first. There are several ways to do this:

  • Include ibase60 in your uses clause, set UseEmbeddedFirebird to true
  • On Windows, with FPC newer than 2.5.1, put fbembed.dll in your application directory
  • On Windows, put the fbembed.dll in your application directory and rename it to fbclient.dll

Pre 2.5.1 versions of FPC did not try to load the fbembed library by default. See FPC bug 17664 for more details.

An indication of which DLLs need to be installed on Windows (Firebird 2.5, differs between versions:

  • fbclient.dll (or fbembed.dll)
  • firebird.msg
  • ib_util.dll
  • icudt30.dll
  • icuin30.dll
  • icuuc30.dll
  • msvcp80.dll
  • msvcr80.dll

Please see your database documentation for details.

The TIBConnection component does not reliably detect computed fields as such. This means that automatically generated update sql statements will attempt to update these fields, resulting in SQL errors. These errors can be avoided by removing the pfInUpdate flag from the provideroptions from a field, once it has been created:

MyQuery.FieldByName('full_name').ProviderFlags:=[];
Creates a TIBConnection object Owner of the connection; use nil when not using a widgetset. Creates a database on disk

Instructs the Interbase or Firebird database server to create a new database.

If set, the (specifically, PAGE_SIZE) and properties influence the database creation.

If creating a database using a client/server environment, the TIBConnection code will connect to the database server before trying to create the database. Therefore make sure the connection properties are already correctly set, e.g. , , .

If creating a database using Firebird embedded, make sure the embedded library is loaded, the property is empty, and set the to e.g. 'SYSDBA'. See for details on loading the embedded database library.

Deletes a database from disk

DropDB instructs the Interbase/Firebird database server to delete the database that is specified in the .

In a client/server environment, the TIBConnection code will connect to the database server before telling it to drop the database. Therefore make sure the connection properties are already correctly set, e.g. , , .

When using Firebird embedded, make sure the embedded connection library is loaded, the property is empty, and set the to e.g. 'SYSDBA'. See for more details on loading the embedded library.

Write this amount of bytes per BLOB segment

Deprecated since FPC 2.7.1 revision 19659

When sending BLOBs to the database, the code writes them in segments.

Before FPC 2.7.1 revision 19659, these segments were 80 bytes and could be changed using BlobSegmentSize. Please set BlobSegmentSize to 65535 for better write performance.

In newer FPC versions, the BlobSegmentSize property is ignored and segments of 65535 bytes are always used.

Retrieves database dialect

Gets the Interbase/Firebird database dialect. You should take account of dialect when sending queries to the database.

Note: the dialect for new Interbase/Firebird databases is 3; dialects 1 and 2 are only used in legacy environments. See your database documentation for more details.

The dialect as a number Name of the server to connect to

HostName specifies the server to connect to.

In a client/server environment, this is the hostname or IP address of the Interbase/Firebird server. If the server uses some TCP/IP port other than the default 3050, add a slash (/) and the port number after the server name.

Documentation for Firebird 2.0 and up indicates that on Windows, you can also connect to a server on local machine using the local transport protocol, in which case HostName must be empty.

If using an embedded Firebird database, the name must be empty. Please see for details on loading the right library

Examples:

MyConnection.HostName:='firebird.example.com'; //Connect via TCP/IP using hostname

MyConnection.HostName:='127.0.0.1/3000'; //Connect to port 3000 on localhost via TCP/IP

MyConnection.HostName:=''; //Connect to embedded server or perhaps using local transport protocol on Windows

Please see your database documentation for details.

Name of the database to connect to

Name of the Interbase/Firebird database to connect to.

This can be either the path to the database or an alias name. Please see your database documentation for details.

In a client/server environment, the name indicates the location of the database on the server's filesystem, so if you have a Linux Firebird server, you might have something like /var/lib/firebird/2.5/data/employee.fdb

If using an embedded Firebird database, the name is a relative path relative to the fbembed library.

Database dialect

Firebird/Interbase servers since Interbase 6 have a dialect setting for backwards compatibility. It can be 1, 2 or 3, the default is 3.

Note: the dialect for new Interbase/Firebird databases is 3; dialects 1 and 2 are only used in legacy environments. In practice, you can ignore this setting for newly created databases.

Keep open connection after first query Determines whether to keep the connection open once it is established and the first query has been executed. Switch for showing custom login prompt If true, the OnLogin event will fire, allowing you to handle supplying of credentials yourself. Firebird/Interbase specific parameters

Params is a of name=value combinations that set database-specific parameters.

The following parameter is supported:

  • PAGE_SIZE: size of database pages (an integer), e.g. 16384.

See your database documentation for more details.

Event triggered when a login prompt needs to be shown. OnLogin is triggered when the connection needs a login prompt when connecting: it is triggered when the LoginPrompt property is True, after the BeforeConnect event, but before the connection is actually established. Describes class Child of TConnectionDef used to register an Interbase/Firebird connection, so that it is available in "connection factory" scenarios where database drivers/connections are loaded at runtime and it is unknown at compile time whether the required database libraries are present on the end user's system. Firebird/Interbase child of Descriptive name Firebird/Interbase child of ConnectionClass Class of connection Description for the Firebird/Interbase child of The description identifies this ConnectionDef object as a Firebird/Interbase connection. Description