summaryrefslogtreecommitdiff
path: root/libodbcpp/command.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-11-25 19:26:04 +0000
committerrandomdan <randomdan@localhost>2010-11-25 19:26:04 +0000
commitbf8c4b6990a203c28b92ca09e170d0cbea206092 (patch)
tree9591f50c8c39b7b33a4b4659b0c997545aa7c79a /libodbcpp/command.cpp
parentTidy up jam stuff (diff)
downloadlibdbpp-odbc-bf8c4b6990a203c28b92ca09e170d0cbea206092.tar.bz2
libdbpp-odbc-bf8c4b6990a203c28b92ca09e170d0cbea206092.tar.xz
libdbpp-odbc-bf8c4b6990a203c28b92ca09e170d0cbea206092.zip
Use proper ODBC SQL_SUCCEEDED macro, not SQL_SUCCESS comparison
Diffstat (limited to 'libodbcpp/command.cpp')
-rw-r--r--libodbcpp/command.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libodbcpp/command.cpp b/libodbcpp/command.cpp
index 50dd679..db6a51c 100644
--- a/libodbcpp/command.cpp
+++ b/libodbcpp/command.cpp
@@ -8,21 +8,21 @@ ODBC::Command::Command(const Connection & c, const std::string & s) :
connection(c)
{
RETCODE rc = SQLAllocHandle(SQL_HANDLE_STMT, c.conn, &hStmt);
- if (rc != SQL_SUCCESS) {
+ if (!SQL_SUCCEEDED(rc)) {
throw Error(rc, SQL_HANDLE_STMT, hStmt, "Allocate statement handle");
}
rc = SQLSetStmtAttr(hStmt, SQL_ATTR_CURSOR_TYPE, (SQLPOINTER)SQL_CURSOR_DYNAMIC, 0);
- if ((rc != SQL_SUCCESS)) {
+ if (!SQL_SUCCEEDED(rc)) {
throw ConnectionError(rc, SQL_HANDLE_STMT, hStmt, "Set scrollable cursor");
}
rc = SQLPrepare(hStmt, (SQLCHAR*)sql.c_str(), sql.length());
- if (rc != SQL_SUCCESS) {
+ if (!SQL_SUCCEEDED(rc)) {
SQLFreeHandle(SQL_HANDLE_STMT, hStmt);
throw Error(rc, SQL_HANDLE_STMT, hStmt, "Prepare statement");
}
SQLSMALLINT pcount;
rc = SQLNumParams(hStmt, &pcount);
- if (rc != SQL_SUCCESS) {
+ if (!SQL_SUCCEEDED(rc)) {
SQLFreeHandle(SQL_HANDLE_STMT, hStmt);
throw Error(rc, SQL_HANDLE_STMT, hStmt, "Parameter count");
}