This is normal situation that an error occurs when connection is broken. If you need to restore the connection, you should call the Disconnect and then Connect method of the connection:
Code: Select all
try
IBCConnection.Disconnect;
except
end;
IBCConnection.Connect;
You can also try to use the failover feature of IBDAC. This feature allows to reconnect automatically. To you this feature, set the LocalFailover option of TIBCConnection to True, write a hander for the OnConnectionLost event of TIBCConnection, and use separate transactions for reading and writing data. See also the 'Using IBDAC \ Working in an unstable network' article in the IBDAC help for more information about using failover.