Dropping or Changing a Server Connection
Go Up to Managing Server Connections
A connection component drops a connection to the application server when you:
- Set the Connected property to False.
- Free the connection component. A connection object is automatically freed when a user closes the client application.
- Change any of the properties that identify the application server (ServerName, ServerGUID, ComputerName, and so on). Changing these properties allows you to switch among available application servers at run time. The connection component drops the current connection and establishes a new one.
Note: Instead of using a single connection component to switch among available application servers, a client application can instead have more than one connection component, each of which is connected to a different application server.
Before a connection component drops a connection, it automatically calls its BeforeDisconnect event handler, if one is provided. To perform any special actions prior to disconnecting, write a BeforeDisconnect handler. Similarly, after dropping the connection, the AfterDisconnect event handler is called. If you want to perform any special actions after disconnecting, write an AfterDisconnect handler.
See Also
- Data.DB.TCustomConnection.BeforeDisconnect
- Connecting to the Server
- Calling Server Interfaces
- Connecting to an Application Server That Uses Multiple Data Modules