473,811 Members | 3,256 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert MS Access data to XML programmaticall y

Thu
I store me reporting data in MS Access table, and I need
to programmaticall y 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 9460
Hi,

Load the data in a dataset. Use the dataset.writexm l method to save
it as xml.
Dim da As OleDbDataAdapte r

Dim conn As OleDbConnection

Dim ds As New DataSet

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

da = New OleDbDataAdapte r("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 programmaticall y 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.x ml"
' Create the FileStream to write with.
Dim myFileStream As New System.IO.FileS tream _
(filename, System.IO.FileM ode.Create)
' Create an XmlTextWriter with the fileStream.
Dim myXmlWriter As New System.Xml.XmlT extWriter _
(myFileStream, System.Text.Enc oding.Unicode)
' Write to the file with the WriteXml method.
thisDataSet.Wri teXml(myXmlWrit er)
myXmlWriter.Clo se()
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 programmaticall y 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
8268
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 and query to convert too. Can someday provide me with at least one tool name ? Thanks,
3
12945
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 by hand! Thanks, Bill
1
3471
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 Dim tbl As ADOX.Table Dim idx As ADOX.Index Dim prp As ADOX.Property
2
23028
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 app from the Excel file? I have made a reference to the Excel 11.0 object library, but am not sure what code comes next. Thanks,
1
1712
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 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...
2
2284
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 properly, as well as a few other annoying little things that we have learned to live with. However, at this point in time, I am looking at converting over to Access 2007. At first I thought that adp's were no longer supported, but then I found out...
4
2551
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 . Following is the code : try { string receivedPath = "c:\\NEW\\";
1
1639
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 10 1000 3 5 5000 next page Soap
7
12319
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 direct link to the data, and in order to update it, you must republish. I am referring to the HTML Format. The second format, IDC, is an older, obsolete technology that runs on Microsoft web Servers. IDC has limited functionality, no script language...
0
1375
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 TextBox = CreateReportControl(strDynamicFinalReport, acTextBox, acFooter, , strFieldNM, intFieldPos, intFieldLine, intFieldRptWidth, intFieldHeight) Gave the following Error: Error Number: 2148 The number you used to refer to the form or report section...
0
9731
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10405
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7671
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.