Alaska Software Inc. - How to know if a database connection was lost
Username: Password:
AuthorTopic: How to know if a database connection was lost
Joao GrenhasHow to know if a database connection was lost
on Fri, 21 Apr 2017 20:03:57 +0100
Hello all,
imagine the following cenario:
- A mapped network drive, example, M:
- An application in M:\Test\Test.exe opening M:\Test\Test.DBF
- We disconnect the network cable (1m, 2m, whatever...).
- We reconnect the network cable.
- If we try to do database operations it will generate errors because of 
lost connection. Not always in the same place: LastRec(), Dbskip(), 
DbGoBottom(), DbRunlock(), etc...

First: The reason to disconnect the network cable is just to force the 
situation. The real situation is to somehow lost it and get i back. Example, 
a power failure and some router along the way rebooted, or any other 
situation...

Question: Is there a way to know if that situation happenned? Any Xbase++ 
configuration or funcion? Something like "HasLostConnection"?

Best Regards