Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 269577 - Last Review: May 8, 2003 - Revision: 2.1
BUG: Cannot Cancel Execution of Command/Recordset Through the Shape Provider
This article was previously published under Q269577
When you are using the Shape Provider, it is not possible to cancel an asynchronous operation.
The data Shape Provider does not pass the
Cancel on to the underlying provider.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Steps to Reproduce Behavior
- Start Visual Basic and create a Standard EXE project. Form1 is created by default.
- On the Project menu, click to select References, and set a reference to the Microsoft ActiveX Data Objects 2.5 Library.
- 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"
- 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.
APPLIES TO
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate