Sign in Join
FPDoc Onlineexperiment

TIBConnection class

In unit IBConnection

TIBConnection: Firebird/Interbase specific TSQLConnection.

Declaration

pascal
TIBConnection = class(TSQLConnection)

Inheritance

  1. TIBConnection
  2. TSQLConnection
  3. TDatabase
  4. TCustomConnection
  5. TComponent
  6. TPersistent
  7. 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

Properties

BlobSegmentSizepublicWrite this amount of bytes per BLOB segment.
ODSMajorVersionpublicDatabase On-Disk Structure major version.
DatabaseNamepublishedName of the database to connect to.
DialectpublishedDatabase dialect.
CheckTransactionParamspublishedLet StartTransaction check transaction parameters.
KeepConnectionpublishedKeep open connection after first query.
LoginPromptpublishedSwitch for showing custom login prompt.
ParamspublishedFirebird/Interbase specific parameters.
PortpublishedPort at which the server listens.
UseConnectionCharSetIfNonepublishedFor string/blob fields with codepage none, use the connection character set when copying data.
WireCompressionpublishedUse wire compression when communicating with the server.

Methods

DoConnectprotected
DoInternalConnectprotected
DoInternalDisconnectprotected
GetHandleprotected
AllocateCursorHandleprotected
DeAllocateCursorHandleprotected
AllocateTransactionHandleprotected
PrepareStatementprotected
UnPrepareStatementprotected
FreeFldBuffersprotected
Executeprotected
AddFieldDefsprotected
Fetchprotected
LoadFieldprotected
GetTransactionHandleprotected
Commitprotected
RollBackprotected
StartDBTransactionprotected
CommitRetainingprotected
RollBackRetainingprotected
UpdateIndexDefsprotected
LoadBlobIntoBufferprotected
RowsAffectedprotected
GetSchemaInfoSQLprotected
GetNextValueSQLprotected
CreatepublicCreates a TIBConnection object.
GetConnectionInfopublicReturn some information about the connection.
CreateDBpublicCreates a database on disk.
DropDBpublicDeletes a database from disk.

Events

OnLoginpublishedEvent triggered when a login prompt needs to be shown.

Inherited

From TSQLConnection (54)

AddFieldDef AddFieldToUpdateWherePart ApplyFieldUpdate ApplyRecUpdate CharSet CodePage Connected ConnOptions ConstructDeleteSQL ConstructInsertSQL ConstructRefreshSQL ConstructUpdateSQL CreateCustomQuery Destroy EndTransaction ExecuteDirect FieldNameQuoteChars GetAsSQLText GetAsString GetConnectionCharSet GetDBInfo GetFieldNames GetNextValue GetObjectNames GetProcedureNames GetSchemaNames GetSequenceNames GetStatementInfo GetTableNames Handle HasTable HostName InitialiseUpdateStatement Log LogEvent LogEvents LogParams MaybeConnect OnLog Options Password PortParamName RefreshLastInsertID RegisterStatement Role SetTransaction StartImplicitTransaction StartTransaction Statements StrToStatementType Transaction UnPrepareStatements UnRegisterStatement UserName

From TDatabase (12)

CheckConnected CheckDisConnected CloseDataSets CloseTransactions Directory DoDisconnect GetConnected GetDataset GetDataSetCount IsSQLBased TransactionCount Transactions

From TCustomConnection (20)

AfterConnect AfterDisconnect BeforeConnect BeforeDisconnect Close CloseForDestroy DataSetCount DataSets DoCloseError DoLoginPrompt ForcedClose GetLoginParams InternalHandleException Loaded OnCloseError Open SetConnected SetForcedClose SetLoginParams StreamedConnected

From TComponent (73)

_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loading Name Notification ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState

From TPersistent (5)

Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (37)

AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.