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::eTypeIsIncompatibleRequested datatype of parameter or column is not compatible with real datatype.
CGOdbcEx::eIndexOutOfRangeIndex is out of range
CGOdbcEx::eFieldNotFoundField is not found in cursor
CGOdbcEx::eAllParameterAlreadyBoundAll 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);
    }