  | |  | Does MyODBC support SQL_ATTR_CONNECTION_DEAD? | Does MyODBC support SQL_ATTR_CONNECTION_DEAD? 2005-09-06 - By Gu Lei
Back Hello:
This is my source code: bool DBConnection::isDead() { SQLINTEGER stringLengthPtr; SQLINTEGER attr; SQLRETURN rc=SQLGetConnectAttr(hdbc,SQL_ATTR_CONNECTION_DEAD,&attr,sizeof(attr), &stringLengthPtr); if(rc<0) { cerr<<"Source File : "<<__FILE__<<endl; cerr<<"Line Number : "<<__LINE__<<endl; cerr<<"SQLGetConnectAttr failed"<<endl; cerr<<getSQLError(SQL_HANDLE_DBC,hdbc); return true; } else if(attr == SQL_CD_TRUE) return true; else return false; }
attr always is 0 even when database is stopped. I need an ODBC function to detect status of database connection. Is there anything wrong in my code? Regards, Gu Lei
-- MySQL ODBC Mailing List For list archives: http://lists.mysql.com/myodbc To unsubscribe: http://lists.mysql.com/myodbc?unsub=mysql@(protected)
Earn $52 per hosting referral at Lunarpages.
|
|
 |