summaryrefslogtreecommitdiff
path: root/libodbcpp/connection.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-06-11 09:03:42 +0000
committerrandomdan <randomdan@localhost>2010-06-11 09:03:42 +0000
commit1df33cc9d9a7804c78788d5717435ede44855ca0 (patch)
treeb78e66de0a9f7d6bb39038d6f628cbc871ffa652 /libodbcpp/connection.cpp
parentInitial workings of project2 - renders gentoobrowse homepage (diff)
downloadlibdbpp-odbc-1df33cc9d9a7804c78788d5717435ede44855ca0.tar.bz2
libdbpp-odbc-1df33cc9d9a7804c78788d5717435ede44855ca0.tar.xz
libdbpp-odbc-1df33cc9d9a7804c78788d5717435ede44855ca0.zip
Use Glib::ustring in libodbcpp for data and std::string for non-data
Add support for parameters in SqlViews Uses parameters to implement category browse and search
Diffstat (limited to 'libodbcpp/connection.cpp')
-rw-r--r--libodbcpp/connection.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libodbcpp/connection.cpp b/libodbcpp/connection.cpp
index e3e92c7..6adcf09 100644
--- a/libodbcpp/connection.cpp
+++ b/libodbcpp/connection.cpp
@@ -29,7 +29,8 @@ ODBC::Connection::Connection(const DSN& d) :
throw Error(dberr, SQL_HANDLE_ENV, env, "Set connection attributes");
}
- dberr = SQLConnect(conn, d.dsn, SQL_NTS, d.username, SQL_NTS, d.password, SQL_NTS);
+ dberr = SQLConnect(conn, (SQLCHAR*)d.dsn.c_str(), SQL_NTS,
+ (SQLCHAR*)d.username.c_str(), SQL_NTS, (SQLCHAR*)d.password.c_str(), SQL_NTS);
if ((dberr != SQL_SUCCESS)) {
throw Error(dberr, SQL_HANDLE_DBC, conn, "Connect");
}
@@ -40,7 +41,7 @@ ODBC::Connection::Connection(const DSN& d) :
}
}
-ODBC::Connection::Connection(const String & s) :
+ODBC::Connection::Connection(const std::string & s) :
env(0),
conn(0),
txDepth(0),
@@ -66,7 +67,7 @@ ODBC::Connection::Connection(const String & s) :
throw Error(dberr, SQL_HANDLE_ENV, env, "Set connection attributes");
}
- dberr = SQLDriverConnect(conn, NULL, s, s.length(), NULL, 0, NULL, SQL_DRIVER_NOPROMPT);
+ dberr = SQLDriverConnect(conn, NULL, (SQLCHAR*)s.c_str(), s.length(), NULL, 0, NULL, SQL_DRIVER_NOPROMPT);
if ((dberr != SQL_SUCCESS)) {
throw Error(dberr, SQL_HANDLE_DBC, conn, "Connect");
}