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: Access Violation Occurs When You Open a Recordset with a Different Lock Type


View products that this article applies to.

This article was previously published under Q314639

↑ Back to the top


Symptoms

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

↑ Back to the top


Resolution

There is no known workaround for this problem.

↑ 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. 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.

↑ Back to the top


Keywords: KB314639, kbfix, kbbug

↑ Back to the top

Article Info
Article ID : 314639
Revision : 7
Created on : 4/6/2004
Published on : 4/6/2004
Exists online : False
Views : 277