Unable to Update/Edit Connectionless ADO Recordset (w/XML)... 
Author Message
 Unable to Update/Edit Connectionless ADO Recordset (w/XML)...

My goal is to bind an XML document to a ADO Recordset... make my changes,
then update it by sending and XML document back to the server.  Here is my
code:

    Dim objStream As New ADODB.Stream
    Dim objRS As New ADODB.Recordset

    objStream.Open
    objStream.WriteText sXML

    objRS.CursorLocation = 3
    objStream.Position = 0
    objRS.Open objStream

    objRS!first_name="Bob"     'I get an error here... cannot edit recordset
I guess?

    Set objStream = Nothing
    Set objRS = Nothing

The error I get is:
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
Run-Time ERROR '3251'

Object or provider is not capable of performing requested operation.
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////

Basically how can I update an ADO recordset that uses XML?

Help is very much appreciated,
Aaron



Mon, 08 Dec 2003 15:31:23 GMT
 Unable to Update/Edit Connectionless ADO Recordset (w/XML)...

Aaron,
I apologize that I'm not able to answer your question directly, however if
all you want to do
is read an xml file into an ado recordset, update the recordset and write
the changed xml back to the original file then this might help.
http://www.assetta.com/xmloledb/home.htm
It's an OLE DB provider for XML based on the MS Simple Provider.
It's not been fully tested and the development version pops up a dialog. If
you are interested I advise you to read the documentation carefully.

cheers
Robbie


Quote:
> My goal is to bind an XML document to a ADO Recordset... make my changes,
> then update it by sending and XML document back to the server.  Here is my
> code:

>     Dim objStream As New ADODB.Stream
>     Dim objRS As New ADODB.Recordset

>     objStream.Open
>     objStream.WriteText sXML

>     objRS.CursorLocation = 3
>     objStream.Position = 0
>     objRS.Open objStream

>     objRS!first_name="Bob"     'I get an error here... cannot edit
recordset
> I guess?

>     Set objStream = Nothing
>     Set objRS = Nothing

> The error I get is:

////////////////////////////////////////////////////////////////////////////
Quote:
> ///////////////////////////////////////////////////////////
> Run-Time ERROR '3251'

> Object or provider is not capable of performing requested operation.

////////////////////////////////////////////////////////////////////////////

- Show quoted text -

Quote:
> ///////////////////////////////////////////////////////////

> Basically how can I update an ADO recordset that uses XML?

> Help is very much appreciated,
> Aaron



Mon, 08 Dec 2003 23:28:24 GMT
 Unable to Update/Edit Connectionless ADO Recordset (w/XML)...

Quote:
>     objRS.CursorLocation = 3
>     objStream.Position = 0
>     objRS.Open objStream
>     objRS!first_name="Bob"     'I get an error here... cannot edit
recordset
> I guess?

I can guess. See this

objRS.Open objStream

It is not well specified. You don't specify a lock type so it defaults to
read only. Hence you cannot edit the recordset.

VB programmers seem to take perverse delight in leaving off missing
parameters for methods.
It causes nothing but grief. Always, _always_ add on the cursortype,
cursorlocation, locktype, options for Open()
You get better performance if you do. All the books say so.

Stephen Howe



Tue, 09 Dec 2003 11:17:53 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Unable to Update/Edit Connectionless ADO Recordset (w/XML)...

2. ADO + XML: Updating recordset from xml-document

3. connectionless ADO RECORDSET

4. Filter on connectionless ADO recordset?

5. Unable to update ADO Recordset

6. Load XML file to a RecordSet then Update Database using ADO

7. ADO update of recordset loaded from dynamically-generated XML

8. Unable to edit snapshot recordset

9. ADo ADD New and Update also Edit Update

10. Editing XML Persistent recordset

11. Error Occurs Opening an ADO Recordset from an XML ADO Stream

12. XML recordsets in ADO & ADO.NET


 
Powered by phpBB® Forum Software