Re: adodb.recordset.save and back

From: Peter Plumber (Klempner_at_gmxdot.net)
Date: 03/09/04


Date: Tue, 09 Mar 2004 09:20:14 +0100

Thx for that hint

seems to be very useful

Peter

Rinoo Rajesh wrote:
> What I can gather from your mail trail below is that you wish to persist a
> recordset into XML (and you have been successful in that) and now wish to
> have a method to update back the data into some table - by loading the
> persisted XML file back into recordset, right?
>
> Well, if you wish to do what i have outlined in the text above, there is no
> straight way, but it is possible. You see, the problem is that it is easy to
> load the XML file back into the recordset (would be a disconnected one at
> that moment anyway) - for example:
>
> Dim Rs as New ADODB.Recordset
>
> RS.Open "XML FILE PATH"
>
> As easy as that!
>
> However, the problem starts when you wish to use the RS.Update or RS.
> UpdateBatch stuff. ADO will throw out an error stating that there is
> insufficient base table information to perform an update. you can't then
> connect to a database and perform
> any batch updates. The problem is that a stand-alone Recordset has an empty
> Source property, and when you reconnect it to the database you get the error
> "Insufficient Base Table Information".
>
> What is missing in a stand-alone Recordset are three field attributes that
> indicate from which database, table and field the
> corrisponding value comes. If you create a new Field object using the
> Fields.Append method you can't specify these properties, nor you can add
> them later because field properties can't be extended.
>
> This can be handled, via XML Schema that you have embedded in the XML
> persisted recordset. At this point, I would like to draw your attention to
> an excellent article on VB2TheMAX titled "Connect a stand-alone Recordset to
> a database using XML". Search it on the google if you can't locate the
> article. It provides sample code and technique to do the stuff.
>
> Let me know if you need more help on this one.
>
> Regards,
>
> Rinoo Rajesh



Relevant Pages

  • Re: adodb.recordset.save and back
    ... persisted XML file back into recordset, ... Dim Rs as New ADODB.Recordset ... and when you reconnect it to the database you get the error ...
    (microsoft.public.data.ado)
  • Re: Recordset to XML and back
    ... As soon as you keep same schema definition for the XML file as original ADO ... then you should be able to load this XML back into recordset. ... example how to *switch* ADO recordset from one database to another one. ...
    (microsoft.public.vb.database.ado)
  • Re: Nullable attribute on field
    ... Do you need to change it is a recordset or database? ... you cannot do this on opened recordset. ... you would need to save recordset as XML into XML DOM and modify ... In a case if you need to change attribute of the column in a database, ...
    (microsoft.public.data.ado)
  • reading XML data
    ... I have an XML file, and trying to convert it into a database table. ... collection of a recordset? ...
    (microsoft.public.access.externaldata)
  • Re: How to import certain fields from access database?
    ... I added the code but its not displaying any values in the textboxes. ... The first imports data from a database ... Dim myActiveRecord As Recordset ...
    (microsoft.public.word.mailmerge.fields)