Skip to content

Commit f375e35

Browse files
szekerestNathanW2
authored andcommittedMar 28, 2012
Use forward only cursor in all queries
1 parent f07b3f9 commit f375e35

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎src/providers/mssql/qgsmssqlprovider.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ void QgsMssqlProvider::loadFields()
354354
if ( mFidColName.isEmpty() )
355355
{
356356
mQuery.clear();
357+
mQuery.setForwardOnly( true );
357358
if (!mQuery.exec( QString( "exec sp_pkeys N'%1', NULL, NULL" ).arg( mTableName ) ))
358359
{
359360
QString msg = mQuery.lastError().text();
@@ -370,6 +371,7 @@ void QgsMssqlProvider::loadFields()
370371
foreach( QString pk, pkCandidates )
371372
{
372373
mQuery.clear();
374+
mQuery.setForwardOnly( true );
373375
if (!mQuery.exec( QString( "select count(distinct [%1]), count([%1]) from [%2].[%3]" )
374376
.arg( pk )
375377
.arg( mSchemaName )

0 commit comments

Comments
 (0)
Please sign in to comment.