03-01-2013, 03:06 PM
Try db.conn.State, maybe it is different when server is down. Or will be error. Or try other db.conn functions. Or even db.Query. Should be error if server is down. Or even try to Open temporarily with other Database variable.
In any case, I recommend to measure speed of database testing code. If too slow, try other ways, or make bigger timer period. Use function perf (microseconds) or timeGetTime (milliseconds).
I would also try db.conn events. For example Disconnect. Read about COM events in QM help.
Also, if possible, don't use global variable for Database. Change declaration from Database+ db to Database- db.
In any case, I recommend to measure speed of database testing code. If too slow, try other ways, or make bigger timer period. Use function perf (microseconds) or timeGetTime (milliseconds).
I would also try db.conn events. For example Disconnect. Read about COM events in QM help.
Also, if possible, don't use global variable for Database. Change declaration from Database+ db to Database- db.