Handling loss of connection (exceptions) to a SQL Server 2000 DB

Hi,

I have a program in Delphi 5 that accesses a database on SQL Server 2000.
I want to be able to detect when the connection is down, i.e. stopped or
loss of network etc...
I stop the service while I'm using the application to see how it will react.
I have used the TApplication.OnException event to capture all exceptions.
In there I check the errors object for the ADOConnection, which has a count
of zero.
I can see in the unit ComObj it raises the exception in SafeCallError, and
in there it has an error code.
Firstly, is it possible to get this error code (GetLastError returns zero).
Also what is the best way to handle loss of connection to the SQL Server DB?

Any help is much appreciated,

thanks

Dan