WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADO

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

XML Primer

 Keywords:  XML primer

The following is attached under the premise that it is sometimes better to see things than to just read about them. As there have been recent threads concerning XML, this may help clarify a few points for others interested in persisted recordsets.

When I (and others) use the term XML Recordset it refers to a 'special case' data file which is created from the ADO Save() method [ this method refers to a Recrodset Object ].

RS.Save("temp.xml",1)
will create an ascii file named temp.xml which can later be opened and treated as though it were an Access or Oracle Table. The RS [ in RS.Save() ], can refer to either an exiting table in a database, the results of a query, or a fabricated recordset [ just fields and values entered on the fly ].

There are 2 parts to an XML Recordset, the schema and the data section. The schema is more or less a data dictionary for each field in the Recordset; the data ( often caled z-row data ) is simply the data for each field enclosed in single quotes.

The two attached xml files were created from the attached script makexml.wbt. They are essentially the same, except for meta-data in the schema section which directly relates to how the original table was opened. ubatch.xml was created with the keyset cursor and batchupdate lock mode, which default.xml just used defaults. Examine both with Notepad, ubatch contains attribute entries for basetable and basecolumn which allows the xml data to be re-integrated back into the original table, or (and this is important) another database with a table with the same name and structure as the original.

default.xml lacks basetable data, but since it is just an ASCII File, these could be added.

Finally, there is the xmladdro script [which doesn't add rows, it just modifies data ]. Run this script [assuming you have MDAC installed] and it will

Copy the ubatch.xml to ubatchu.xml
Open ubatchu as a Recordset
Change the Company field to lower case (there are only two rows )
Save the results
Now look at the data section of ubatchu with notepad and compare it to ubatch - because ubatchu has base table attributes, it preserves the original values as well as the edited value - very useful if you wanted to update your original table based on modifications you made to the xml file.

Now, if you were to modify the script and put in code to add a row of data, then look at the results in notepad you would probably see rs:insert /rs:insert tags around it.

Hope this is useful.

stan littlefield

[XML Primer files.zip]


Article ID:   W16768
File Created: 2019:08:14:09:34:20
Last Updated: 2019:08:14:09:34:20