473,406 Members | 2,377 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,406 software developers and data experts.

Convert MS Access data to XML programmatically

Thu
I store me reporting data in MS Access table, and I need
to programmatically generate XML file (in text) that
loads these data, include all these data with appropriate
definition, i.e. root, elements, entities, and sends
these data to another party on daily basis.

Does anyone know the easiest way to achieve this? Is
there a class that loads data from MS Access, match them
with definition files, and generate XML text file
automatically?

Thanks.
Nov 20 '05 #1
2 9399
Hi,

Load the data in a dataset. Use the dataset.writexml method to save
it as xml.
Dim da As OleDbDataAdapter

Dim conn As OleDbConnection

Dim ds As New DataSet

conn = New OleDbConnection("Provider = Microsoft.JET.OleDB.4.0; Data Source
= USCG.mdb")

da = New OleDbDataAdapter("Select * from Rules", conn)

da.Fill(ds)

ds.WriteXml("C:\Rules.xml")

Ken

-----------------

"Thu" <th***********@hotmail.com> wrote in message
news:02****************************@phx.gbl...
I store me reporting data in MS Access table, and I need
to programmatically generate XML file (in text) that
loads these data, include all these data with appropriate
definition, i.e. root, elements, entities, and sends
these data to another party on daily basis.

Does anyone know the easiest way to achieve this? Is
there a class that loads data from MS Access, match them
with definition files, and generate XML text file
automatically?

Thanks.

Nov 20 '05 #2
you need to use the oledbconnection, dataadapter and generate a dataset from
them. Us the writexml method of the dataset to write the data to the
currently set iostream

HTH

Private Sub WriteXmlToFile(thisDataSet As DataSet)
If thisDataSet Is Nothing Then
Return
End If
' Create a file name to write to.
Dim filename As String = "myXmlDoc.xml"
' Create the FileStream to write with.
Dim myFileStream As New System.IO.FileStream _
(filename, System.IO.FileMode.Create)
' Create an XmlTextWriter with the fileStream.
Dim myXmlWriter As New System.Xml.XmlTextWriter _
(myFileStream, System.Text.Encoding.Unicode)
' Write to the file with the WriteXml method.
thisDataSet.WriteXml(myXmlWriter)
myXmlWriter.Close()
End Sub
--
Regards - One Handed Man

Author : Fish .NET & Keep .NET
=========================================
This posting is provided "AS IS" with no warranties,
and confers no rights.
"Thu" <th***********@hotmail.com> wrote in message
news:02****************************@phx.gbl...
I store me reporting data in MS Access table, and I need
to programmatically generate XML file (in text) that
loads these data, include all these data with appropriate
definition, i.e. root, elements, entities, and sends
these data to another party on daily basis.

Does anyone know the easiest way to achieve this? Is
there a class that loads data from MS Access, match them
with definition files, and generate XML text file
automatically?

Thanks.

Nov 20 '05 #3

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

Similar topics

12
by: Guy | last post by:
I got a big Access file (1 400 tables) to convert to SQL and I would like to be provided with some automated tools, except upsizing wizard and DTS, to convert it on my own. I got a lot of forms...
3
by: Bill Nicholson | last post by:
What tools are available to convert Access projects (Forms, Code, Queries, Reports) to VB Dot Net? Does anyone have experience with this type of conversion? Please tell me I don't have to do it...
1
by: sunlight_sg | last post by:
Hello, i am using ADOX + VB .NET to create a Access Database programmatically. I plan to set some properties of the column such primary key. The code is as follows: Dim cat As ADOX.Catalog...
2
by: Ronald S. Cook | last post by:
Hi, I need to open an Excel file from within my ASP.NET app and read data. I'm guessing the most like format in ASP.NET would be a DataTable. Regardles,, how do I get the data into my ASP.NET...
1
by: Parasyke | last post by:
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...
2
by: Carla Hepker | last post by:
I have several in-house applications that I have developed over the years using vba in Access Data Projects. When we converted the SQL server over to 2005, some of the sorts no longer functioned...
4
by: krishp | last post by:
Hi, I need to convert raw data recieved from a device through C#.Net socket to BMP format. For some reason the image conversion is not happening proparly and I can see only blur image . ...
1
by: yogeshbhardwaj | last post by:
I have an excel sheet. its format is like a group eport in access example given below: Soap Sr. no. Qty. Amount 1 15 150 2 ...
7
ADezii
by: ADezii | last post by:
There are essentially three techniques for publishing Access Data on the Web. The first technique is static, and does not allow for the dynamic addition or modification to the data, There is no...
0
by: rmurgia | last post by:
I am trying to create an Access report programmatically. So far I have been able to accomplish everything except the following: 1) I cannot determine the code to create a Page Footer Set...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.