Skip to content
Permalink
Browse files

Use forward only cursor in all queries

  • Loading branch information
szekerest authored and NathanW2 committed Mar 28, 2012
1 parent f07b3f9 commit f375e351f34d33fe4bf9ccc9e11d7dc58d897cbb
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/providers/mssql/qgsmssqlprovider.cpp
@@ -354,6 +354,7 @@ void QgsMssqlProvider::loadFields()
if ( mFidColName.isEmpty() )
{
mQuery.clear();
mQuery.setForwardOnly( true );
if (!mQuery.exec( QString( "exec sp_pkeys N'%1', NULL, NULL" ).arg( mTableName ) ))
{
QString msg = mQuery.lastError().text();
@@ -370,6 +371,7 @@ void QgsMssqlProvider::loadFields()
foreach( QString pk, pkCandidates )
{
mQuery.clear();
mQuery.setForwardOnly( true );
if (!mQuery.exec( QString( "select count(distinct [%1]), count([%1]) from [%2].[%3]" )
.arg( pk )
.arg( mSchemaName )

0 comments on commit f375e35

Please sign in to comment.
You can’t perform that action at this time.