From 3eb4aacf07c77876c6ce68e9746906424934433b Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 15 Apr 2009 13:22:48 +1000 Subject: Fixes an issue with FreeTDS and quoting. Microsofts SQL Server odbc driver calls SET QUOTED_IDENTIFIER_ON, but freetds doesn't, so any quoting fails. This fixes that issue. Reviewed-by: abcd --- src/sql/drivers/odbc/qsql_odbc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 71b1b2a..d6423ae 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -55,6 +55,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -1800,6 +1801,10 @@ bool QODBCDriver::open(const QString & db, d->checkHasMultiResults(); setOpen(true); setOpenError(false); + if(d->isMSSqlServer) { + QSqlQuery i(createResult()); + i.exec(QLatin1String("SET QUOTED_IDENTIFIER ON")); + } return true; } -- cgit v0.12