473,766 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert Access data to XML

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_Clic k(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnLoadXml.Clic k
Dim xtr As XmlTextReader = _
New XmlTextReader(" C:\Documents and Settings\dcampb e\My
Documents\Visua l Studio 2005\Projects\3 10C02\310C02\Bo oks.xml")
xdd = New XmlDataDocument ()
ds = xdd.DataSet()
ds.ReadXmlSchem a(xtr)
xtr.Close()
xtr = New XmlTextReader(" C:\Documents and Settings\dcampb e\My
Documents\Visua l Studio 2005\Projects\3 10C02\310C02\Bo oks.xml")
xtr.WhitespaceH andling = WhitespaceHandl ing.None
xdd.Load(xtr)
dgXML.DataSourc e = ds
dgXML.DataMembe r = "Book"
xtr.Close()
End Sub
Private Sub btnSave_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnSave.Click
Dim xtw As XmlTextWriter = New XmlTextWriter(" C:\Documents and
Settings\dcampb e\My Documents\Visua l Studio
2005\Projects\3 10C02\310C02\Bo oks.xml", System.Text.Enc oding.UTF8)
xtw.Formatting = Formatting.Inde nted
xdd.WriteTo(xtw )
'Clean up
xtw.Close()
MessageBox.Show ("The XML file has been successfully updated !")

End Sub

Jun 14 '06 #1
1 1708
Hello Parasyke,

You could...
Create a DataSet
Create a DataTable in the DataSet
Fill the DataTable with data from the Access DB
Serialize the DataSet to disk or memory for editing

Then to round-trip it..
Deserialize the XML doc back into a DataSet
Update the Access DB from the DataSet

-Boo
Jun 14 '06 #2

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

Similar topics

1
26303
by: SD | last post by:
Hi, This is driving me nuts, I have a table that stores notes regarding an operation in an IMAGE data type field in MS SQL Server 2000. I can read and write no problem using Access using the StrConv function and I can Update the field correctly in T-SQL using: DECLARE @ptrval varbinary(16) SELECT @ptrval = TEXTPTR(BITS_data)
25
4386
by: cory | last post by:
Hi, I have an Access database and am having an ASP.NEt application written for it. It is almost complete. I have a hosting company that I signed up with a month ago but before I did anything I asked them if Access and ASP.NET would work on their servers, they said yes so I bought in. Now they are saying my application wont work on their servers using MSaccess and I can only use SQL or asp 3.0. They are saying Microsoft is trying to...
3
2183
by: Nigel C | last post by:
I have been tasked with converting a legacy Access 2 system to Access 2000. This in itself is not the issue. I have a copy of the Program, Data and SYSTEM.MDA file used by the client. However, I can not gain access to the programs as I do not have a copy of Access 2 to an know nothing about the access security model to be able to gain access to the system. When I try to open the PROGRAM file I get the following message - "You don't...
3
2705
by: ET | last post by:
I don't know whats the problem, but after I added functions to first verify, then relink linked tables if not found, now I can't convert that database to MDE format. I can split the database, but can't convert part of the database with forms, reports, queries to MDE format. Can somebody advice on this? References, in the order, from the top:
3
2873
by: Jon S via DotNetMonster.com | last post by:
Hi all, Is there a way to convert an Access.mdb from one format (say Access '97 or Access 2000) to Access 2002 format using ADO.NET and C#??? I know how to do it manually using the Access DBMS but I would like to know how to do it programatically. I don't have any idea if this can be done so if it can please could someone show the code to do it or provide links so I can read up on how to do it.
3
12937
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
29
2645
by: Jan | last post by:
Hi: I have an Access database that's been running (in one form or another) for a couple of different clients for a few years. Now a new client has requested that it be implemented with a SQL server back-end. I'm doing my best to learn about SQL server, and I plan to leave the front-end more or less as-is, just linking to the SQL server back end, but here's a basic question: The db has a front-end linked to two back-ends. One of the...
2
4239
by: egoldthwait | last post by:
I need to convert a 17mb access 2000 db to Oracle and house it in a Citrix farm. The issue: we have never converted an Access Db to Oracle but can probably use Oracle's Workbench to assist with this. Also - the citrix folks do not want us to keep the FE in Access as the queries and other activities consume a lot of power. The users will be in 3 different offices across the globe all accessing the 1 Oracle DB in Citrix. Does anyone have...
5
2576
by: melickas | last post by:
We designed a custom application using Office Developer Tools '97 which included a Run-time version of Access--- so it would not matter if our customer even had any version of Access on their computer. The application ran without problems on our customer's computer for 2-3 years. Then our customer bought a new computer and we had to reinstall the application. Everything was ok for approximately 6 months until our customer was "cleaning up"...
1
2697
by: vinodkus | last post by:
dear sir/madam How to convert sql server data to ms access. Please help me Thanks in advance
0
9404
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
10168
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9959
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,...
1
7381
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
6651
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();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3929
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
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.