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 pointers would be appreciated. Thanks in advance.

Barry

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.




.



Relevant Pages

  • Re: convert query into xml-file
    ... Transform to transform the XML from the ADO recordset schema to the ...
    (microsoft.public.access.queries)
  • Re: How does ADO 2 update a SQL stored procedure recordset?
    ... > Generally when I want to use ADO 2 to update a recordset based on a MSSQL ... > call a second stored procedure to perform the update. ... Well if you have SELECTed the columns in the recordset that form the Primary ... You are running SQL Server. ...
    (microsoft.public.data.ado)
  • Re: Returning results from a temporary table using ADO
    ... > I 'm trying to invoke a stored procedure using ADO from a web page. ... > The error manifest itself as an empty recordset or a closed recordset ... > creates and populates a temporary table and to have the results of that ...
    (microsoft.public.vb.database.ado)
  • Re: Is ADO Dead (3)?
    ... The Design of ADO ... ADO uses a single object, the Recordset, as a common representation for ... a forward-only stream of results from a database, ... where data is updated at the data source or cached locally as with the ...
    (comp.databases.ms-access)
  • Re: Is ADO Dead (3)?
    ... The Design of ADO ... ADO uses a single object, the Recordset, as a common representation for ... a forward-only stream of results from a database, ... where data is updated at the data source or cached locally as with the ...
    (comp.databases.ms-access)