PRB: Asynchronous Fetching Is Not Available with OLE DB (301667)



The information in this article applies to:

  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.6

This article was previously published under Q301667

SYMPTOMS

When you use SQL commands that return messages in an asynchronous fashion, such as the Microsoft SQL Server BACKUP ... WITH STATS command, which returns a %Complete message at points in the procedure, the command executes, but the notification messages are returned all at once when the command finishes.

If the command is run from ODBC, the messages are fetched asynchronously as expected.

CAUSE

This is by design in MDAC version 2.6 and earlier. Asynchronous execution is supported in OLE DB, but asynchronous fetching is not. You can use the client cursor engine to achieve asynchronous fetching for procedures such as retrieving records, but this does not extend to informational messages.

RESOLUTION

To work around this problem, use ODBC or SQL-DMO (Distributed Management Object), both of which have an asynchronous fetch, for the BACKUP case that is listed earlier.

Modification Type:MajorLast Reviewed:10/17/2003
Keywords:kbprb KB301667