473,385 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

trying to save Access dataset as XML file

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!

Nov 20 '05 #1
4 1121
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
"Mary McRae" <ma*******@sprintpcs.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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!

Nov 20 '05 #2
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
Nov 20 '05 #3
Mary,

You can try this, in my opinion much better than any book.

http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

And if you have problems installing it

http://msdn.microsoft.com/vbasic/vbr...q/#installvdir

I hope this helps a little bit?

Cor
Nov 20 '05 #4
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
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: deko | last post by:
I create an XmlDataDocument Dataset when the main form of my WinForms app opens. The user will make changes to the Dataset, and then those changes should be saved to the XML file when the code...
4
by: Jae | last post by:
I'm writing a web application that exports and imports excel files. The application gets a list of users and their info and displays it in a datagrid .The user then selects to save the file as a...
12
by: Ron Weldy | last post by:
I have a test server runinng 2003/IIS 6 with a mixture of asp and asp.net files. On my workstation I have a share set up to the folder where the web files reside. I am just doing quick and dirty...
2
by: PB | last post by:
I need to enable users to download data in either an Excel file or an Access database (MDB file). The data they need exists in a SQL Server database: the XLS or MDB file does not actually exist...
1
by: Siegfried Heintze | last post by:
I'm using a third party hosting service. I presently have a Web Service on this hosting service's server that loads and executes a native mode DLL. This demonstrates that the hosting service has...
10
by: Henok Girma | last post by:
Hello Gurus, I want to save the state of an unbound DataGridView on my Windows Form application to an XML file so i can later load it back.. Basically, on my form I have a DataGridView, it's got...
6
by: alexia.bee | last post by:
Hi all, I am new to C# so please bear me :). I have an app which uses datagridview. it has 8 columns. I also have struct which has 8 members(the same as the datagridview). when I add row to...
1
by: Laila2008 | last post by:
Hi, I'm writing a String containing XML data to my browser. The XML data is well formed and the page opens up correctly but when I try to read this data from another page I get the following error:...
0
by: rclarke | last post by:
I am writing an application which needs to save data to a new Jet (MS Access) database. What I would like to clarify is that there is no straightforward way of simply saving an existing DataSet as an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.