My application must have an on-line and an off-line mode. I want to use a timer that call a function (attached) which checks for the connectivity of an SOL server every 15 seconds. If the server is or becomes available for connection, the connection must be made to the SQL server, a small panel must change to green and the online mode must become active and if the server becomes unavailable the panel must turn red and the application must go in off line mode.
Using my attached function, when the application starts and the QSL server is not available, e.g. the user is out of the office, then the application hangs while
ADOConnection1.Connected := True;
tries to establish the connection, instead of just carrying on and setting the panel to Red.
If the server is initially available, the connection is made flawlessly. However when the server then gets disconnected, the program remains in Online mode and the panel remains green. Naturally then if the program executes a query, an exception is raised.
Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.