Microsoft KB Archive/314639

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

Article ID: 314639

Article Last Modified on 4/6/2004

-

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

-



This article was previously published under Q314639



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.



Steps to Reproduce Behavior
 Create a new Visual Basic project. Form1 is created by default.  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 &quot;DSN=Pubs;UID=sa;PWD=;&quot; ' 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 &quot;select * from authors&quot;,, adOpenDynamic, adLockOptimistic rs.Close rs.Open &quot;select * from authors&quot;,, adOpenDynamic, adLockReadOnly  Run the project.

Keywords: kbbug kbfix KB314639

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.