[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'db' (#fcl)

# TCustomConnection.BeforeConnect

Event triggered before a connection is made.

## Declaration

Source position: db.pas line 1611

`published property TCustomConnection.BeforeConnect: TNotifyEvent read FBeforeConnect write SetBeforeConnect;`

## Description

BeforeConnect is called before a connection is attempted in TCustomConnection.Open. It can be used to set connection parameters, or to abort the establishing of the connection: if an exception is raised during this event, the connection attempt is aborted.

## See also

TCustomConnection.Open |  | Makes the connection to the server
TCustomConnection.AfterConnect |  | Event triggered after a connection is made.
TCustomConnection.OnLogin |  | Event triggered when a login prompt is shown.

The latest version of this document can be found at lazarus-ccr.sourceforge.net .