Q: Difference by executing SQL in SQLOLEDB and MSDASQL I have an problem with the following SQL String:
DECLARE @s varchar(1000), @ver nvarchar(128)
SET @ver = Server Version (e.g. 11 for SQL Server 2012)
SELECT @s = case
WHEN
(CheckVersion (e.g. Enterprise)) AND @ver > 9
THEN
'BACKUP DATABASE [DB] TO DISK = ''C:\Backup\DBBackup.bak'' WITH  COMPRESSION, NOFORMAT, NOINIT, SKIP, REWIND, NOUNLOAD, STATS = 10'
ELSE
'BACKUP DATABASE [DB] TO DISK = ''C:\Backup\DBBackup.bak'' WITH  NOFORMAT, NOINIT, SKIP, REWIND, NOUNLOAD, STATS = 10;'
END
EXEC (@s)

(This is the short Version, i know that this don't work)
When im using SQLOLEDB Provider everything works fine and the Backupfiles getting created.
The same Command in MSDASQL don't crash, but even create no Backupfile.
Could someone explain, why the same command works with SQLOLEDB and not with MSDASQL? 
What is the specific different between these two Providers?

A: Got fixed the Problem.
OLEDB via ADO has always had the issue where DONE_IN_PROC messages (rows affected) confuse code that is not expecting them. A workaround without app code changes is to specify SET NOCOUNT ON as the first statement in the Batch.
