Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Converting access data to XML

Reply
Thread Tools

Converting access data to XML

 
 
Parasyke
Guest
Posts: n/a
 
      06-14-2006
Thanks in advance. I'm new to XML. I need to convert an existing Access

table into XML which will allow me on a form to read the table into
XML, edit, then reconvert it back to the Access table. I have
successfully added the Northwind database to my data sources in Visual
Studio 2003 (Standard Edition). I also have the following code which
reads from an EXISTING XML file not related to the Access file. How
could I alter it to pull from Access? Below is the read and Write SUBS
for the existing XML:

Private Sub btnLoadXml_Click(ByVal sender As System.Object, ByVal e



As System.EventArgs) Handles btnLoadXml.Click
Dim xtr As XmlTextReader = _
New XmlTextReader("C:\Documents and Settings\dcampbe\My
Documents\Visual Studio 2005\Projects\310C02\310C02\Books.xml")
xdd = New XmlDataDocument()
ds = xdd.DataSet()
ds.ReadXmlSchema(xtr)
xtr.Close()
xtr = New XmlTextReader("C:\Documents and Settings\dcampbe\My
Documents\Visual Studio 2005\Projects\310C02\310C02\Books.xml")
xtr.WhitespaceHandling = WhitespaceHandling.None
xdd.Load(xtr)
dgXML.DataSource = ds
dgXML.DataMember = "Book"
xtr.Close()
End Sub


Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As



System.EventArgs) Handles btnSave.Click
Dim xtw As XmlTextWriter = New XmlTextWriter("C:\Documents and
Settings\dcampbe\My Documents\Visual Studio
2005\Projects\310C02\310C02\Books.xml", System.Text.Encoding.UTF
xtw.Formatting = Formatting.Indented
xdd.WriteTo(xtw)
'Clean up
xtw.Close()
MessageBox.Show("The XML file has been successfully updated !")



End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML data access or DB data access ? Savvoulidis Iordanis ASP .Net 2 01-07-2009 10:47 PM
Converting HTML input data to pre-format XML data Elijah Odumosu Ruby 1 04-29-2008 06:56 PM
Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-file jkflens XML 2 05-30-2006 09:41 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Print XML parsing to JspWriter (out) Class org.xml.sax.helpers.NewInstance can not access a member of class javax.xml.parsers.SAXParser with modifiers "protected" Per Magnus L?vold Java 0 11-15-2004 02:27 PM



Advertisments