TIB_Connection Object
Properties Methods Events

Unit
IB_Components

Declaration
TIB_Connection = class(TIB_Component)

Description
This component obtains a persistent connection to an InterBase database.

It is responsible to provide all of the properties and methods that are associated with an InterBase database.

It also provides many useful features that assist in making the job of administering a database easier.

It is best to use this component instead of the TIB_DataBase component because it allows you to have more versitility with transaction handling. Only use the TIB_Database component during the process of converting away from the BDE since it emulates the transaction behavior by forcing all connected statements and datasets to use its own internally defined transaction. This behavior prevents you from having statements and datasets configured in separate transactions.

See the dbHandleShared property to see how you can share a single connection to an InterBase database with BDE based components TDatabase, TQuery, etc.

IBO has been designed with compatibility in mind so that IBO can augment applications which by necessity must remain BDE based. Some benefits from doing this is that you can have additional concurrent transactions using IB's full transaction capabilities and even cross database transactions involving the connection being used by the BDE.

Introduced Public Properties
AliasName  This property provides the ability to use a BDE Alias for the database connection string and other limited values.
AliasParams  Property where the parameter values of the current AliasName are stored.
AnnounceFocus  Property that determines whether or not this component should have its focusing announced throughout the session when it becomes the focused connection.
Buffers  Number of client buffers to be used with the connection.
CacheStatementHandles  Determines whether or not IBO will cache acquired statement handles.
Characteristics  Property that returns a number of connection characteristics.
CharSet  Property to determine the character set to use for the connection.
ColumnAttributes  Global property used to centralize settings for column attributes.
Connected  Returns or determines whether or not a connection has been obtained.
ConnectionStatus  Status of this component's connection.
Database  This property determines the string used to locate the database to attach to.
DatabaseName  This gives an alias-like name to the connection.
DatasetCount  Returns the number of datasets that are associated to this connection.
Datasets  Returns a dataset by index of all associated datasets for the connection.
dbHandle  Native InterBase connection handle.
dbHandleShared   Native InterBase connection handle.
DBKeyScope  This property is used to determine how the DB_KEY scope should be treated for the database connection.
DefaultNoCase  This property can be used to have all string/text fields default to being used as though field=NOCASE was specified in the column attributes.
DefaultNoTrailing  This property can be used to have all string/text fields default to being searched as though field=NOTRAILING was specified in the column attributes.
DefaultTransaction 
DefaultValues  Global property used to centralize settings for column default values.
EscapeCharacter  Provides the escape character to be used in "LIKE" specifications during ExtractSQLWhere (the building of select statements during search mode).
FieldEntryTypes  This property is required to tell whether or not entries have been made in the connection level properties of using domain names or SQL types:

ColumnAttributes
DefaultValues
FieldsAlignment
FieldsCharCase
FieldsDisplayLabel
FieldsGridLabel
FieldsDisplayFormat
FieldsDisplayWidth
FieldsEditMask
FieldsReadOnly
FieldsTrimming
FieldsVisible
GeneratorLinks
FieldsAlignment  Global property used to centralize settings for column attributes.
FieldsCharCase  Global property used to centralize settings for column attributes.
FieldsDisplayFormat  Global property used to centralize settings for column attributes.
FieldsDisplayLabel  Global property used to centralize settings for column attributes.
FieldsDisplayWidth  Global property used to centralize settings for column attributes.
FieldsEditMask  Global property used to centralize settings for column attributes.
FieldsGridLabel  Global property used to centralize settings for column attributes.
FieldsReadOnly  Global property used to centralize settings for column attributes.
FieldsTrimming  Global property used to centralize settings for column attributes.
FieldsVisible  Global property used to centralize settings for column attributes.
ForcedWrites  Property to return or set the forced writes flag for a database.
GeneratorLinks  Global property used to centralize settings for generator assignments.
HasActiveTransaction  This property tells whether or not the connection has an active transaction in it.
IsHandleShared  Property that returns whether the current connection is shared or not.
KeepConnection  This property is work in progress.
License  Not sure how this is implemented but it gives the DPB as documentd in the API guide.
LoginAborted  Property that tells if the user aborted the login proocess.
LoginAttempts  Property that determines how many failed attempts the user may have when logging in to the database.
LoginCaption  This is the caption used on the default login dialog.
LoginDBReadOnly  Property that determines whether or not the user can alter the path of the database that will be used for the connection.
LoginHelpContext  This will provide an optional help context number so that help can be provided to the user upon logginn in to their application.
LoginPrompt  If true a login prompt will be presented to the user so that they can enter in their username and password.
LoginRegKey  This property is used to locate information in the system registry for storing various login related information.
LoginSQLRole  This property returns the Role that the user typed into the login dialog.
LoginSQLRoleList  In order to have a list of SQL Role names to choose from, include them in this property separated by semi colons and the user will be able to choose a SQL Role from a combobox with these values in it.
LoginSQLRolePrefix  For convenience, I have resources defined with a prefix to keep them separate per application.
LoginUsername  This property returns the name that the user typed into the login dialog.
LoginUsernamePrefix  For conveneince, a prefix can be added to the actual Username that the user enters into the login dialog.
MessageFile  Property that allows an alternate message file to be used.
PageSize  Page size for the database connected to or about to be created.
Params  This property gives direct access to the connection parameters stored in the string list.
Password  Password of person logging in to the database.
Path  Path where the database resides on the server that hosts it.
PdbHandle  Pointer to the native InterBase connection handle.
Protocol  This porperty determines the protocol used for the connection.
ReservePageSpace  Property to return or set the reserve page space flag for a database.
SchemaCache  This property stores all of the information that IBO needs to know about the metadata of the database.
SchemaCacheDir  If this property is set to a valid path then IBO will maintain a local cache of information that will make it so that metadata queries will not have to be performed in order to accomplish certain tasks.
Server  For remote connections, this is the name of the server where the database resides.
SQLDialect  This property allows the SQL Dialect feature of InterBase to be used.
SQLRole  This property allows the SQL ROLE feature of InterBase to be used.
StatementCount  Returns the number of statements that are associated to this connection.
Statements  Returns a statement by index of all associated statements for the connection.
SweepInterval  Sweep Interval for the database connected to.
SysDBA  Name of the SYSDBA for the connection.
TransactionCount  Returns the number of transactions that are associated with the connection.
Transactions  Returns a transaction by index of all associated transactions for the connection.
Username  Username of the person logging into a database.
Users  Property to get the usernames logged on to the current database.

Introduced Public Methods
AlterUser   This method will add/modify/delete a user to the server specified in the Database property using the Protocol, Username and Password properties too.
BuildDPB   Method used to build the DPB when obtaining a connection to the database.
Close   Method to detach from the database.
CloseTransactions   Method which will cause all transactions for the connection to be closed.
Connect   Method to attach to the database.
CreateDatabase   Method to create a database using the current properties defned.
DeallocateStatements   Method which will cause all statements to be deallocated.
Disconnect   Methods to detach from the database.
DropDatabase   Method to drop (delete) a database.
FlushSchemaCache   Use this method if an alteration to the database's metadata structure was executed through a non-DSQL means.
FreeStmtHandleCache   This method will trim up the number of statement handles in the cache.
GetSoundEx   These methods are used to access the soundex conversion functionality built into the connection.
GetSoundExMax   These methods are used to access the soundex conversion functionality built into the connection.
IsSQLBased   BDE emulation property.
Open   Method to attach to the database.
ProcessDMLCacheItem   This method is used to initiate the announcement of a DMLCacheItem so that all the datasets in this connection can synchronize to changes that have taken place externally to the connection.
RequestReconnect   This method sets a flag that will cause the connection to do a quick reconnect and disconnect upon disconnecting from the database.
SetFocus   Make this database connection the currently focused connection for the session.
VerifyConnection   Work in progress.

Introduced Public Events
AfterConnect  Connection event notification.
AfterCreateDatabase  Connection event notification.
AfterDisconnect  Connection event notification.
AfterDropDatabase  Connection event notification.
AfterExecDDL  Connection event notification.
BeforeConnect  Connection event notification.
BeforeCreateDatabase  Connection event notification.
BeforeDisconnect  Connection event notification.
BeforeDropDatabase  Connection event notification.
BeforeExecDDL  Connection event notification.
OnConnectedChanged  Connection event notification.
OnCustomizeDPB  This event is used to further refine the DPB hat is used in the API call to establish the database connection.
OnGainFocus  This event is triggered when a control that is attached through this connection becomes focused.
OnLogin  This event is triggered when a database connection is being established and the LoginPrompt property is set to true.
OnLoginFailure  This event is triggered when the user fails to successfully login.
OnLoseFocus  This event is triggered when a control that is attached to another connection becomes focused and this connection is losing focus.
OnProcessSearchBuffer  This event gives the developer the ability to enhance and extend the search buffer processing capabilities of IBO.
OnReceiveDMLCache  This event gives an opportunity to reject or modify a DML cache entry that is coming in from the external environment.
OnSoundExMaxParse  This event gives the developer the ability to define a SoundEx parsing routine that supports range selection.
OnSoundExParse  This event gives the developer the ability to define a SoundEx parsing routine to be used during searches.