QODBC - keep alive PHP script maintains DCOM object for connect errors

Sometimes, the QODBC DCOM object times out after a period of no activity. the MS DCOM manager is supposed to relaunch the DCOM instance if another request is made, and the object is not available. Sometimes it does not do this, and QODBC fails to open a connection to to QB.

 

The solution is to periodically make requests so the DCOM object never times out.

Attached .php script does this by periodcially issueing a SELECT * from Terms statement to the QODBC DSN. (Quickbooks Data)

 

Note params that can be set in the script:

$hoursToRun = 23;  // run this many hours, then exit
$minPerReq  = 5;  // #minutes between requests to host QB DB

Article Details

Article ID:
181
Date added:
2013-03-21 15:57:23
Views:
749
Rating (Votes):
(530)