Skip to content

Commit

Permalink
Use forward only cursor in all queries
Browse files Browse the repository at this point in the history
  • Loading branch information
szekerest authored and NathanW2 committed Mar 28, 2012
1 parent f07b3f9 commit f375e35
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/providers/mssql/qgsmssqlprovider.cpp
Expand Up @@ -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();
Expand All @@ -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 )
Expand Down

0 comments on commit f375e35

Please sign in to comment.