Microsoft Knowledge Base Email Alertz

(314639) - If you close a recordset, and then reopen the recordset with a different lock type, an access violation may occur.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 314639 - Last Review: April 6, 2004 - Revision: 6.1

BUG: Access Violation Occurs When You Open a Recordset with a Different Lock Type

This article was previously published under Q314639

On This Page

SYMPTOMS

If you close a recordset, and then reopen the recordset with a different lock type, an access violation may occur.

RESOLUTION

There is no known workaround for this problem.

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. Create a new Visual Basic project. Form1 is created by default.
  2. Double-click Form1, and then paste the following code in the Form_Load event:
        Dim cn As New ADODB.Connection
        Dim rs As New ADODB.Recordset
        cn.Open "DSN=Pubs;UID=sa;PWD=;" ' Replace this connection string with one valid on your system, pointing to the Pubs sample database.
        Set rs.ActiveConnection = cn
        rs.CursorLocation = adUseClient
        rs.Open "select * from authors", , adOpenDynamic, adLockOptimistic
        rs.Close
        rs.Open "select * from authors", , adOpenDynamic, adLockReadOnly
    					
  3. Run the project.

APPLIES TO
  • Microsoft Data Access Components 2.1
  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.7
  • Microsoft Data Access Components 2.6
Keywords: 
kbbug kbfix KB314639
       

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