I have an application in Lazarus that connects to a MS Access 2007 database that is on a shared resource on a local network through an ODBCConnection control. The program works correctly and I can perform SQL queries without any problem.
However, I have noticed that when the computer hosting the database is not available, my Lazarus application hangs waiting for the connection.
I have searched, but I see that the ODBCConnection control does not have a Timeout property to set.
In this scenario, how could I set a connection timeout of, say, two seconds, so that I can display a database unavailable error message?
Luis Capitanache is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.