By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,689 Members | 1,731 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,689 IT Pros & Developers. It's quick & easy.

MSACCESS export to XML read file into VB .Net dataset

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.