Microsoft Cursor Engine error '80040e21' Multiple-step operation generated errors. Check each status value
Asked Answered
A

1

6

I am having a look on an old web application written in the 90s in VB6 and Active Server Pages (JScript). The application retrieves some data from the database and stores it in a recordset which it is using to update. When it attempts to update a field (see below) it gives an '80040e21' error.

rsSave.Fields('text') = Request.Form('strText').Item(i); // this line fails

I have checked the type of the field and it is adVarWChar (202). I have checked the size of the 'text' field which is 2000, way bigger than what is comming from the form. I checked the status of all fields and they are all adFieldOK (0). In other words any of the usual suspects giving normally this error are ok.

The COM+ object that is creating, filling and then returning the recordset is doing the following:

 'Initialize command object
Set oCmd = CreateObject("ADODB.Command")

With oCmd
    .CommandType = adCmdText
    .CommandText = strsql
End With

Set cn = CreateObject("ADODB.Connection")

'Open connection to database
cn.Open strConn
oCmd.ActiveConnection = cn

Set rs = CreateObject("ADODB.Recordset")

     With rs
        Set .Source = oCmd
        .LockType = adLockBatchOptimistic
        .CursorLocation = adUseClient
        .CursorType = adOpenStatic
        .Open
        Set .ActiveConnection = Nothing
       End With

I tried using adLockOptimistic, but no luck.

Last but not least, this application was using initially an old Microsoft OleDb provider for Oracle that was no longer compatible with windows server 2008. We had to use a new provider and since then some things needed to be adjusted in order to work properly.

Any ideas?

Allonge answered 27/5, 2016 at 11:36 Comment(9)
What about the oCmd object where's the that?Maxie
It is initialized further upp. Set oCmd = CreateObject("ADODB.Command") With oCmd .CommandType = adCmdText .CommandText = strsql End WithAllonge
And the strsql (can you see a pattern forming...)? Try not to add code into the comments, just edit the question and add the missing code.Maxie
@Lankymart: The strsql is a long query defined further up. It works just fine as it fills the recordset with data (I can see what it contains, it is not EOF). The problem occurs when I try to update a field with a new value.Allonge
We had to use a new provider Which one?Unction
Possible duplicate of Getting "Multiple-step operation generated errors. Check each status value." error using ADO with SQL server 2008Maxie
@SearchAndResQ: We had to move from MSDAORA to OraOLEDB.Oracle provider. The MSDAORA was not compatible with windows server 2008.Allonge
@Lankymart: I was already reading that post and I will try to implement that solution. Thanks anyway!Allonge
Good to know information like that would have been useful in the initial question though.Maxie
S
0

I used to get these when I was writing from VB6 to a DB2 database using IBM OLE DB Provider. It was always related to either the data being incompatible with the underlying field type, or the content was too large. Check dates, strings being written into integers, vice versa, etc.

I would try a process of elimination. Write data only one field, defaulting the others to the minimum thy will accept, then keep adding fields with the expected data until it triggers an error. At least it will tell you which field it is.

Sorry I don't have much more to offer.

Stepfather answered 18/3, 2021 at 1:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.