Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Datalogger auto-REconnection for PostgreSQL
#3
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.

Code:
Copy      Help
,case WM_TIMER
,out db.conn.State
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.


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)