BUG: Cannot Cancel Execution of Command/Recordset Through the Shape Provider (269577)



The information in this article applies to:

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

This article was previously published under Q269577

SYMPTOMS

When you are using the Shape Provider, it is not possible to cancel an asynchronous operation.

CAUSE

The data Shape Provider does not pass the Cancel on to the underlying provider.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Visual Basic and create a Standard EXE project. Form1 is created by default.
  2. On the Project menu, click to select References, and set a reference to the Microsoft ActiveX Data Objects 2.5 Library.
  3. Paste in the following code into the Form Load Sub:
        Dim conn As New Connection
        Dim rs As New Recordset
    
        conn.Open "Provider=MSDatashape" & _
                  ";Data Provider=sqloledb" & _
                  ";Data Source=<server_name>" & _
                  ";User ID=<uid>;Password=<pwd>;"
        
        'Using No Shape Provider works
        conn.Open "Provider=sqloledb" & _
                  ";Data Source=<server_name>" & _
                  ";User ID=<uid>;Password=<pwd>;"
    
        Debug.Print
        Debug.Print Timer
        rs.Open "select * from sysobjects, syscomments, sysindexes", conn, adOpenStatic, adLockOptimistic, adAsyncExecute
        Debug.Print "Attempting to Cancel " & Timer
        rs.Cancel
        Debug.Print "Cancel finally executed" & Timer
        Debug.Print "state: ", rs.State
        Debug.Print "observe how long it takes to carry out the Cancel"
    					
  4. Save and run the project. Note how long it takes to move beyond the Cancel call.NOTE: The query may never cancel due to low virtual memory that may cause the application to stop responding.

Modification Type:MajorLast Reviewed:5/8/2003
Keywords:kbBug kbpending KB269577