[Overview][Constants][Types][Classes][Index] | Reference for unit 'IBConnection' (#fcl)

# TIBConnection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TIBConnection: Firebird/Interbase specific TSQLConnection

## Declaration

Source position: ibconnection.pp line 63

`type TIBConnection = class(TSQLConnection)`
`public`
`constructor Create(); override;` |  | Creates a TIBConnection object
`function GetConnectionInfo(); override;` |  | Return some information about the connection
`procedure CreateDB; override;` |  | Creates a database on disk
`procedure DropDB; override;` |  | Deletes a database from disk
`property BlobSegmentSize: Word; [rw] deprecated ;` |  | Write this amount of bytes per BLOB segment
`property ODSMajorVersion: Integer; [r]` |  | Database On-Disk Structure major version
`published`
`property DatabaseName: string;` |  | Name of the database to connect to
`property Dialect: Integer; [rws]` |  | Database dialect
`property CheckTransactionParams: Boolean; [rw]` |  | Let StartTransaction check transaction parameters
`property KeepConnection: Boolean;` |  | Keep open connection after first query
`property LoginPrompt: Boolean;` |  | Switch for showing custom login prompt
`property Params: TStrings;` |  | Firebird/Interbase specific parameters
`property OnLogin: TLoginEvent;` |  | Event triggered when a login prompt needs to be shown.
`property Port: Cardinal; [s]` |  | Port at which the server listens
`property UseConnectionCharSetIfNone: Boolean; [rw]` |  | For string/blob fields with codepage none, use the connection character set when copying data
`property WireCompression: Boolean; [rw]` |  | Use wire compression when communicating with the server
`end;`

## Inheritance

`TIBConnection` |  | TIBConnection: Firebird/Interbase specific TSQLConnection
`TSQLConnection` |  | An abstract class representing a connection to a SQL Database
`TDatabase` |  | Base class for connecting a FreePascal application to an external Database engine
`TCustomConnection` |  | Abstract class for connections to a server
`TComponent,IUnknown,IInterfaceComponentReference`
`TPersistent,IFPObserved`
`TObject`

## Description

TIBConnection is a descendant of TSQLConnection 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:=[];

## See also

TSQLConnection