469,934 Members | 1,879 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

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 4444
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Shawn Mehaffie | last post: by
3 posts views Thread by curtis m. west | last post: by
15 posts views Thread by rlayberry | last post: by
4 posts views Thread by Hans [DiaGraphIT] | last post: by
reply views Thread by Shawn Mehaffie | last post: by
9 posts views Thread by laredotornado | last post: by
4 posts views Thread by =?Utf-8?B?anAybXNmdA==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.