473,322 Members | 1,781 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,322 software developers and data experts.

MSACCESS export to XML read file into VB .Net dataset

I am trying to read in a xml file that I exported from my
MSAccess table using the following lines of code but it
bombs. Is this the right code? Is there a way to get a
clean export from Access so the XML file will read in OK
into a VB .Net Form dataset?
===============================
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load

Dim myDS As DataSet = New DataSet
myDS.ReadXml
("MyAccessTableExportedtoXML.xml", XmlReadMode.
ReadSchema)

End Sub
==============================

Nov 21 '05 #1
3 4597
Hi,

You are only trying to read in the table structure. Try this
instead.

myDS.ReadXml("MyAccessTableExportedtoXML.xml")

Ken
-----------
"BobAchgill" <an*******@discussions.microsoft.com> wrote in message
news:0d****************************@phx.gbl...
I am trying to read in a xml file that I exported from my
MSAccess table using the following lines of code but it
bombs. Is this the right code? Is there a way to get a
clean export from Access so the XML file will read in OK
into a VB .Net Form dataset?
===============================
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load

Dim myDS As DataSet = New DataSet
myDS.ReadXml
("MyAccessTableExportedtoXML.xml", XmlReadMode.
ReadSchema)

End Sub
==============================
Nov 21 '05 #2
Hi Ken,

I tried what you said and it is still bombing. Any more
ideas? What imports should I be using?

I chose Embed Schema in exported XML document when
exporting the table from MSAccess.

Thanks!

Bob

PS Here is the code and Error
++++++++++++++++++++++++++++++++++++
Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "
Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
Dim myDS As DataSet = New DataSet
'myDS.ReadXml("MyAccessTableExportedtoXML.xml",
XmlReadMode.ReadSchema)
myDS.ReadXml("MyAccessTableExportedtoXML.xml")
End Sub
End Class
===ERROR=================================
An unhandled exception of type 'System.ArgumentException'
occurred in system.data.dll

Additional information: The schema namespace is invalid.
Please use this one instead:
http://www.w3.org/2001/XMLSchema.
==========================================
-----Original Message-----
Hi,

You are only trying to read in the table structure. Try thisinstead.

myDS.ReadXml("MyAccessTableExportedtoXML.xml")

Ken
-----------
"BobAchgill" <an*******@discussions.microsoft.com> wrote in messagenews:0d****************************@phx.gbl...
I am trying to read in a xml file that I exported from my
MSAccess table using the following lines of code but it
bombs. Is this the right code? Is there a way to get a
clean export from Access so the XML file will read in OK
into a VB .Net Form dataset?
===============================
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load

Dim myDS As DataSet = New DataSet
myDS.ReadXml
("MyAccessTableExportedtoXML.xml", XmlReadMode.
ReadSchema)

End Sub
==============================
.

Nov 21 '05 #3
On Fri, 3 Dec 2004 05:37:49 -0800, "BobAchgill" <an*******@discussions.microsoft.com> wrote:

¤ I am trying to read in a xml file that I exported from my
¤ MSAccess table using the following lines of code but it
¤ bombs. Is this the right code? Is there a way to get a
¤ clean export from Access so the XML file will read in OK
¤ into a VB .Net Form dataset?

Is there a reason why you're exporting to XML instead of reading the data directly from Access?
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 21 '05 #4

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

Similar topics

0
by: Shawn Mehaffie | last post by:
I have the following class that I've wirtten to take a Dataset and automatically export it to either XML, ASCII or Tab delimited file. The reason I wrote it they way I did was that I don't want to...
9
by: M O J O | last post by:
Hi, (I'm new to XML) I can export data from Access as an XML file (with schema integrated in the XML file). I can read it into a DotNet DataSet, but the schema is not correct that is - I do...
3
by: curtis m. west | last post by:
hello NG i try to create a little generic vb.net function for exporting access-tables to xml-files. ---===>>> CUT IN <<<===--- Function fncXmlExport(ByVal strDBpath As String, ByVal...
15
by: rlayberry | last post by:
Hi I have found what looks like a huge bug in MSAccess. When I have the following in a table in Access 1996 0.08715292
0
by: Richard Beacroft | last post by:
Trying to write a C# Windows App to export all objects and content from 2 MSAccess 97 databases for comparison analysis. very little documentation found. Have managed to instantiate MSAccess,...
4
by: Hans [DiaGraphIT] | last post by:
Hi! I want to export a dataset to an excel file. I found following code on the net... ( http://www.codeproject.com/csharp/Export.asp ) Excel.ApplicationClass excel = new ApplicationClass();...
0
by: Shawn Mehaffie | last post by:
I have the following class that I've wirtten to take a Dataset and automatically export it to either XML, ASCII or Tab delimited file. The reason I wrote it they way I did was that I don't want to...
9
by: laredotornado | last post by:
Hello, I am tasked with converting an MsAccess db to a MySQL 4 db in a Linux environment. Can anyone recommend any good freeware/scripts to help me do this? Thanks, - Dave
4
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I've got a DataSet that I save as XML using the DataSet DataTable's WriteXml method. If I say XmlWriteMode.IgnoreSchema, it shows up great in Excel, but I can not reopen the file in my...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.