summaryrefslogtreecommitdiff
path: root/libodbcpp/command.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libodbcpp/command.cpp')
-rw-r--r--libodbcpp/command.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libodbcpp/command.cpp b/libodbcpp/command.cpp
index 217954e..4ceb825 100644
--- a/libodbcpp/command.cpp
+++ b/libodbcpp/command.cpp
@@ -3,7 +3,7 @@
#include "param.h"
#include <sqlext.h>
-ODBC::Command::Command(const Connection& c, String s) :
+ODBC::Command::Command(const Connection & c, const std::string & s) :
sql(s),
connection(c)
{
@@ -11,7 +11,7 @@ ODBC::Command::Command(const Connection& c, String s) :
if (rc != SQL_SUCCESS) {
throw Error(rc, SQL_HANDLE_STMT, hStmt, "Allocate statement handle");
}
- rc = SQLPrepare(hStmt, sql, sql.size());
+ rc = SQLPrepare(hStmt, (SQLCHAR*)sql.c_str(), sql.length());
if (rc != SQL_SUCCESS) {
SQLFreeHandle(SQL_HANDLE_STMT, hStmt);
throw Error(rc, SQL_HANDLE_STMT, hStmt, "Prepare statement");