Other classes of library can throw CGOdbcEx
to signal about errors.
Errors can be ODBC errors or errors of library usage.
Methods
bool isUsage();
Method return true
if error is user of library usage and false
if error is ODBC error.
long getCode();
Method returns code of usage error or ODBC's native error code.
List of usage error codes is shown below:
CGOdbcEx::eTypeIsIncompatible | Requested datatype of parameter or column is not compatible with real datatype. | |
CGOdbcEx::eIndexOutOfRange | Index is out of range | |
CGOdbcEx::eFieldNotFound | Field is not found in cursor | |
CGOdbcEx::eAllParameterAlreadyBound | All parameters are already bound |
const char *getMsg();
Method returns textual description of the error.
Example
try { pStmt->execute("select * from table"); } catch(CGOdbcEx *pEx) { MessageBox(m_hWnd, pEx->getMsg(), "Error", MB_OK); } |