0

I'm encountering a "strange" problem and I have no idea of what is happening (I'm new to SQL Server).

I'm doing a database backup to a backup device which I created in SQL Server Management Studio. I'm running a simple query

BACKUP DATABASE abc TO abcBackupDevice

and this works fine, but any following SQLExecDirect returns "Invalid cursor state" error.

I'm running a C++ app in Visual Studio 2012 and SQL Server 2012 Express as well.

Any ideas?

MAXE
  • 4,978
  • 2
  • 45
  • 61
André Moreira
  • 1,669
  • 4
  • 21
  • 35

1 Answers1

0

It was all to do with unhandled result sets. If your query returns some data that data needs to handled or discarded with a SQLMoreResults.

André Moreira
  • 1,669
  • 4
  • 21
  • 35