Re: Make a disconnected recordset editable



You can:
1. Create a new recordset -in memory-, and copy the data
New Rst, Rst.Open, For Each Field( add Field ), For Each Row ( For Each
Field ( copy Field value ))
2. Touch the "updatable" bits of the Rst and re-create it
http://www.xtremevbtalk.com/showthread.php?p=1288726


"Barry Seymour" wrote:

Dang, I thought I deleted this from my outbox before it went out. Oh well,
let me update this and answer your questions.

I added LockBatchOptimistic and got to where I could delete a row. Then I
tried to edit a field or add a field. no go. Here's what I get:

Error -2147217887: Multiple-step operation generated errors. Check each
status value.

The recordset was NOT updatable when I first fetched it. It comes from a
stored procedure and is read only.

Here are my steps:
1. Use ADO command to run a stored procedure and get a read-only Recordset.
2. Convert Recordset to an XML document
3. When needed, create a *new* ADO Recordset...
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockBatchOptimistic
5. Load XML into the recordset
4. Try to update a field in a row. I get this error:
Error -2147217887: Multiple-step operation generated errors. Check each
status value.

Maybe step 1 is where I should look? I'm thinking the original recordset
must be updatable before I do anything else.



"Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx> wrote in message
news:%23Eg1nHkqIHA.4476@xxxxxxxxxxxxxxxxxxxxxxx
1. Did you use the adLockBatchOptimistic locktype?
2. Could the recordset be edited before you saved it to xml?

Barry Seymour wrote:
Many thanks to Bob Barrows for help on my first problem ( see XML to
ADO Recordset and Back Again). Now here's another.

I am trying to create a disconnected, editable recordset from a stored
procedure call in VB6. I've Googled all the relevant code but I can't
get anything
that will let me *edit* the recordset. I always get an error saying
the recordset cannot be edited:

Here are my steps:
1. Use ADO command to get a stored procedure.
2. Convert to an XML document
3. When needed, create a new ADO Recordset, load XML into it
4. Try to insert/update/delete a row. I get this error:

Run-time error '3251':
Current Recordset does not support updating. This may be a
limitation of the provider, or of the selected locktype.

The recordset comes from a stored procedure, not a table. I fetch it
by way of an ADO command object. Are these indicators to ADO that the
recordset should be read-only?

I want to be able to edit the local recordset in order to avoid
repeated trips to the database for updated data.

Any help or