summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers/odbc/qsql_odbc.cpp
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2009-09-30 04:57:14 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2009-09-30 04:57:14 (GMT)
commitb83ea4276a242893c01586a5f1a2d62d54369cfa (patch)
tree49424ef8255c58e338f76ebba776210dad17e6c8 /src/sql/drivers/odbc/qsql_odbc.cpp
parentf4bcf5c9fd51ed1923239ea1ad0d78bcd3d56f62 (diff)
parentb125af1b298d694c332f56deebe4755d0c985d5d (diff)
downloadQt-b83ea4276a242893c01586a5f1a2d62d54369cfa.zip
Qt-b83ea4276a242893c01586a5f1a2d62d54369cfa.tar.gz
Qt-b83ea4276a242893c01586a5f1a2d62d54369cfa.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/sql/drivers/odbc/qsql_odbc.cpp')
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index 7cf5e8b..ff9458b 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -127,7 +127,7 @@ class QODBCPrivate
{
public:
QODBCPrivate(QODBCDriverPrivate *dpp)
- : hStmt(0), useSchema(false), hasSQLFetchScroll(true), driverPrivate(dpp)
+ : hStmt(0), useSchema(false), hasSQLFetchScroll(true), driverPrivate(dpp), userForwardOnly(false)
{
unicode = false;
}
@@ -148,6 +148,7 @@ public:
int disconnectCount;
bool hasSQLFetchScroll;
QODBCDriverPrivate *driverPrivate;
+ bool userForwardOnly;
bool isStmtHandleValid(const QSqlDriver *driver);
void updateStmtHandleState(const QSqlDriver *driver);
@@ -848,7 +849,7 @@ bool QODBCResult::reset (const QString& query)
d->updateStmtHandleState(driver());
- if (isForwardOnly()) {
+ if (d->userForwardOnly) {
r = SQLSetStmtAttr(d->hStmt,
SQL_ATTR_CURSOR_TYPE,
(SQLPOINTER)SQL_CURSOR_FORWARD_ONLY,
@@ -885,7 +886,7 @@ bool QODBCResult::reset (const QString& query)
SQLINTEGER isScrollable, bufferLength;
r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength);
if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
- setForwardOnly(isScrollable==SQL_NONSCROLLABLE);
+ QSqlResult::setForwardOnly(isScrollable==SQL_NONSCROLLABLE);
SQLSMALLINT count;
SQLNumResultCols(d->hStmt, &count);
@@ -1194,7 +1195,7 @@ bool QODBCResult::prepare(const QString& query)
d->updateStmtHandleState(driver());
- if (isForwardOnly()) {
+ if (d->userForwardOnly) {
r = SQLSetStmtAttr(d->hStmt,
SQL_ATTR_CURSOR_TYPE,
(SQLPOINTER)SQL_CURSOR_FORWARD_ONLY,
@@ -1508,7 +1509,7 @@ bool QODBCResult::exec()
SQLINTEGER isScrollable, bufferLength;
r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength);
if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
- setForwardOnly(isScrollable==SQL_NONSCROLLABLE);
+ QSqlResult::setForwardOnly(isScrollable==SQL_NONSCROLLABLE);
SQLSMALLINT count;
SQLNumResultCols(d->hStmt, &count);
@@ -1639,6 +1640,12 @@ void QODBCResult::virtual_hook(int id, void *data)
}
}
+void QODBCResult::setForwardOnly(bool forward)
+{
+ d->userForwardOnly = forward;
+ QSqlResult::setForwardOnly(forward);
+}
+
////////////////////////////////////////