Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

This article was previously published under Q269577

↑ Back to the top


Symptoms

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

↑ Back to the top


Cause

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

↑ Back to the top


Status

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

↑ Back to the top


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.

↑ Back to the top


Keywords: KB269577, kbpending, kbbug

↑ Back to the top

Article Info
Article ID : 269577
Revision : 3
Created on : 5/8/2003
Published on : 5/8/2003
Exists online : False
Views : 299