Microsoft KB Archive/225110

= PRB: No Records Returned from SELECT with FOR UPDATE Against Oracle8 Server =

Article ID: 225110

Article Last Modified on 8/23/2001

-

APPLIES TO


 * Microsoft ActiveX Data Objects 2.0
 * Microsoft ActiveX Data Objects 2.01
 * Microsoft ActiveX Data Objects 2.1
 * Microsoft ActiveX Data Objects 2.5
 * Microsoft ActiveX Data Objects 2.6
 * Microsoft ActiveX Data Objects 2.7

-



This article was previously published under Q225110



SYMPTOMS
The following error occurs when interacting with a recordset from an Oracle 8 server created with a SELECT statement containing the FOR UPDATE clause:

Error ORA-01002, "Fetch out of sequence"



RESOLUTION
To work around this problem, execute the ADO Connection object's BeginTrans method before executing the SELECT statement. Use the CommitTrans method when finished with the recordset.



MORE INFORMATION
The below example will reproduce the behavior described above. Uncomment the BeginTrans and CommitTrans calls to see the workaround.

Note that this behavior occurs with both the OLE DB Provider and the ODBC driver. Also note that the error does not occur when executed against an Oracle 7.3 server.

Steps to Reproduce Behavior
Dim cnn As ADODB.Connection Dim rst As ADODB.Recordset

Set cnn = New ADODB.Connection cnn.CursorLocation = adUseClient cnn.Open "DSN=myoracle8dsn;UID=myuid;PWD=mypwd"

Set rst = New ADODB.Recordset 'cnn.BeginTrans rst.Open "select * from mytable for update", cnn, adOpenDynamic rst.MoveFirst 'cnn.CommitTrans

Keywords: kberrmsg kboracle kbdatabase kbprb KB225110

-

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

© Microsoft Corporation. All rights reserved.