Run-time error '-2147217887 (80040e21)': Multiple-step operationgenerated errors. Check each status

J

jason

Thanks for looking.
code below.


oRS.Open "Select * from tblResults", CN, adOpenDynamic,
adLockOptimistic

Dim nRows, nColumns, Counter1, Counter2
Counter2 = 0
Counter1 = 1

Do Until Err.Number <> 0

Counter1 = vResults(1, Counter2)
'MsgBox oRS.Fields(Counter2).Name & " " & vResults(1, Counter2)

On Error GoTo A
Counter2 = Counter2 + 1
Loop



A:
For nRows = 0 To UBound(vResults, 1)
oRS.AddNew

For i = 0 To Counter2


oRS.Fields(i).Value = vResults(nRows, i)



Next i

oRS.Update
Next nRows
 
D

Dirk Goldgar

jason said:
Thanks for looking.
code below.


oRS.Open "Select * from tblResults", CN, adOpenDynamic,
adLockOptimistic

Dim nRows, nColumns, Counter1, Counter2
Counter2 = 0
Counter1 = 1

Do Until Err.Number <> 0

Counter1 = vResults(1, Counter2)
'MsgBox oRS.Fields(Counter2).Name & " " & vResults(1, Counter2)

On Error GoTo A
Counter2 = Counter2 + 1
Loop



A:
For nRows = 0 To UBound(vResults, 1)
oRS.AddNew

For i = 0 To Counter2


oRS.Fields(i).Value = vResults(nRows, i)



Next i

oRS.Update
Next nRows


I'm not as conversant with ADO as with DAO, but if you want to do batch
processing, don't you have to use adLockBatchOptimistic, rather than
adLockOptimistic?
 
J

jason

I'm not as conversant with ADO as with DAO, but if you want to do batch
processing, don't you have to use adLockBatchOptimistic, rather than
adLockOptimistic?

--
Dirk Goldgar, MS Access MVP
Access tips:www.datagnostics.com/tips.html

(please reply to the newsgroup)- Hide quoted text -

- Show quoted text -

did not work. thank you for the input.
 
D

Dirk Goldgar

I'm not as conversant with ADO as with DAO, but if you want to do batch
processing, don't you have to use adLockBatchOptimistic, rather than
adLockOptimistic?
did not work. thank you for the input.

Same error? Hmm. Can you forego batch processing and do it like this:

'----- start of code snippet -----
oRS.Open _
"Select * from tblResults", CN, _
adOpenDynamic, adLockOptimistic

' ...

For nRows = 0 To UBound(vResults, 1)

oRS.AddNew

For i = 0 To Counter2
oRS.Fields(i).Value = vResults(nRows, i)
Next i

oRS.Update

Next nRows

'----- end of code snippet -----
 
Top