I connect to a remote database with CRecordSet derived class and ODBC. (MyODBC)

The timeout of the remote DB is 5 minutes and I can not change it.

Supposing the timeout time has passed.

- Question 1:
How can I detect the server has disconnected me? I tried CRecordSet::IsOpen() and CDabase::IsOpen() but are still given me TRUE.

- Question 2:
The problem is closing the CRecordSet and opening it again gives me a timeout error message. I have to close the application and run it again. What should I do in order to reconnect again with the DB without closing the Application?

Thank you.