Commit 618ce65a authored by Olivier Bertrand's avatar Olivier Bertrand

Modification of the DBX class to have more information

 in case of error while processing ODBC type tables.

Modified:
odbconn.h
odbconn.cpp
parent df1dfcff
This diff is collapsed.
...@@ -83,20 +83,23 @@ class DBX : public BLOCK { ...@@ -83,20 +83,23 @@ class DBX : public BLOCK {
friend class ODBConn; friend class ODBConn;
// Construction (by ThrowDBX only) -- destruction // Construction (by ThrowDBX only) -- destruction
protected: protected:
DBX(RETCODE rc); DBX(RETCODE rc, PSZ msg = NULL);
public: public:
//virtual ~DBX() {} //virtual ~DBX() {}
//void operator delete(void*, PGLOBAL, void*) {}; //void operator delete(void*, PGLOBAL, void*) {};
// Implementation (use ThrowDBX to create) // Implementation (use ThrowDBX to create)
RETCODE GetRC(void) {return m_RC;} RETCODE GetRC(void) {return m_RC;}
PSZ GetMsg(void) {return m_Msg;}
const char *GetErrorMessage(int i) const char *GetErrorMessage(int i)
{ return (i >=0 && i < MAX_NUM_OF_MSG) ? m_ErrMsg[i] : "No ODBC error"; } {return (i >=0 && i < MAX_NUM_OF_MSG) ? m_ErrMsg[i] : "No ODBC error";}
protected: protected:
void BuildErrorMessage(ODBConn* pdb, HSTMT hstmt = SQL_NULL_HSTMT); void BuildErrorMessage(ODBConn* pdb, HSTMT hstmt = SQL_NULL_HSTMT);
// Attributes // Attributes
RETCODE m_RC; RETCODE m_RC;
PSZ m_Msg;
PSZ m_ErrMsg[MAX_NUM_OF_MSG]; PSZ m_ErrMsg[MAX_NUM_OF_MSG];
}; // end of DBX class definition }; // end of DBX class definition
...@@ -156,7 +159,7 @@ class ODBConn : public BLOCK { ...@@ -156,7 +159,7 @@ class ODBConn : public BLOCK {
// ODBC operations // ODBC operations
protected: protected:
bool Check(RETCODE rc); bool Check(RETCODE rc);
void ThrowDBX(RETCODE rc, HSTMT hstmt = SQL_NULL_HSTMT); void ThrowDBX(RETCODE rc, PSZ msg, HSTMT hstmt = SQL_NULL_HSTMT);
void ThrowDBX(PSZ msg); void ThrowDBX(PSZ msg);
void AllocConnect(DWORD dwOptions); void AllocConnect(DWORD dwOptions);
bool Connect(DWORD Options); bool Connect(DWORD Options);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment