trying to save Access dataset as XML file

M

Mary McRae

I'm creating a small test application where I simply take the contents of an
Access database and write it to an XML file (using Access' default XML).
Once the file is written, I then run it through a transform which basically
merges the contents of the database with a Word XML document instance. The
final file is then saved and returned to the requestor.

I've been pouring over examples, and can't find anything that is exactly
what I'm looking for ... can anyone point me to some samples? I've done
everything manually - that is, export the table and save as XML, run the
transform and create the result file. I've got the transform coded and it
works fine; it's just the database piece I'm missing. I've gotten this far
(without encountering any errors at runtime):

Dim connectString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & thisDBName

Dim myDA As OleDbDataAdapter = New OleDbDataAdapter("SELECT A, B, C FROM
TableX", _
connectString)

Thanks for any and all help!
 
W

William Ryan eMVP

then call dataadapter.Fill(ds);

ds.WriteXML(@"..\someData.xml");

That will output the query resulst into XML . You can get the dataset back
with ReadXML

I can't really understand the missing chunk but I'm guessing this is it. If
not,let me know
 
M

Mary McRae

Thanks for the very quick response, that worked great!

What little time I've spent actually writing MS code is around Office 2003
smart documents; so the vast majority of this stuff is very new to me.

Is there a good book you can recommend on doing VB.NET programming against
Access? I spent a good hour at the local B&N and didn't find much of
anything that looked useful. Of course I didn't know if I really needed an
ASP.NET or ADO.NET or some other book ...

Thanks again!

Mary
 
M

Mary McRae

Thanks, Cor ... I got one of those CDs as part of the VB.NET World Tour grab
bag a couple of weeks ago (along with Whidbey). I'll have to break the seal
and give it a look.

Mary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top