Cannot read exported XML File

Z

Zodiac

Hi all,

I have exported a XML from Access an it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:eek:d="urn:schemas-microsoft-com:eek:fficedata"
generated="2005-05-10T05:25:59">
<qryExportXML>
<Name>Janssens NV</Name>
<LoginWeb>Jans</LoginWeb>
<PWDWeb>Jans</PWDWeb>
<Descrtiption>Klant</Descrtiption>
<Description>Groep A</Description>
<DiscountPercentage>1</DiscountPercentage>
</qryExportXML>
.......

I' trying to read it from an ASP.net page with the following code:


dstPasswords.ReadXml(MapPath("\data\contacts2.xml"))
dtblPasswords = dstPasswords.Tables(0)
arrUsers = dtblPasswords.Select("Name=' " & sUserName & "'")


However I always bump on this error message

System.Data.EvaluateException: Cannot find column [Name].


After some searching I foud that if I delete xmlns:eek:d="urn:schemas-
microsoft-com:eek:fficedata" from the file the column gets found without a
problem!!!


Can someone explain to me wat the problem is?

thks..

rgds

Z.
 
Z

Zodiac

Zodiac...
I would have thought the same that u wouldn't need that.
Patrick

Zodiac said:
Hi all,

I have exported a XML from Access an it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:eek:d="urn:schemas-microsoft-com:eek:fficedata"
generated="2005-05-10T05:25:59">
<qryExportXML>
<Name>Janssens NV</Name>
<LoginWeb>Jans</LoginWeb>
<PWDWeb>Jans</PWDWeb>
<Descrtiption>Klant</Descrtiption>
<Description>Groep A</Description>
<DiscountPercentage>1</DiscountPercentage>
</qryExportXML>
.......

I' trying to read it from an ASP.net page with the following code:


dstPasswords.ReadXml(MapPath("\data\contacts2.xml"))
dtblPasswords = dstPasswords.Tables(0)
arrUsers = dtblPasswords.Select("Name=' " & sUserName & "'")


However I always bump on this error message

System.Data.EvaluateException: Cannot find column [Name].


After some searching I foud that if I delete xmlns:eek:d="urn:schemas-
microsoft-com:eek:fficedata" from the file the column gets found
without a problem!!!


Can someone explain to me wat the problem is?

thks..

rgds

Z.
How to get rid of it.. Every export from access returns this string..

rgds,

Z
 
G

Guest

How are you exporting?
Patrick

Zodiac said:
Zodiac...
I would have thought the same that u wouldn't need that.
Patrick

Zodiac said:
Hi all,

I have exported a XML from Access an it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:eek:d="urn:schemas-microsoft-com:eek:fficedata"
generated="2005-05-10T05:25:59">
<qryExportXML>
<Name>Janssens NV</Name>
<LoginWeb>Jans</LoginWeb>
<PWDWeb>Jans</PWDWeb>
<Descrtiption>Klant</Descrtiption>
<Description>Groep A</Description>
<DiscountPercentage>1</DiscountPercentage>
</qryExportXML>
.......

I' trying to read it from an ASP.net page with the following code:


dstPasswords.ReadXml(MapPath("\data\contacts2.xml"))
dtblPasswords = dstPasswords.Tables(0)
arrUsers = dtblPasswords.Select("Name=' " & sUserName & "'")


However I always bump on this error message

System.Data.EvaluateException: Cannot find column [Name].


After some searching I foud that if I delete xmlns:eek:d="urn:schemas-
microsoft-com:eek:fficedata" from the file the column gets found
without a problem!!!


Can someone explain to me wat the problem is?

thks..

rgds

Z.
How to get rid of it.. Every export from access returns this string..

rgds,

Z
 
Z

Zodiac

Public Sub ExportXML(sSQL As String, sFileName As String)

Dim sXMLPath

On Error GoTo ErrorHandler

'sSQL = "SELECT tblContacts.Name, tblTypes.Description, tblContacts.pwd
FROM tblTypes INNER JOIN tblContacts ON tblTypes.AutoID = tblContacts.Type"
CurrentDb.QueryDefs("qryExportXML").SQL = sSQL
Debug.Print "SQL: " & vbCrLf & sSQL

sXMLPath = Environ$("userprofile") & "\My Documents\" & sFileName
If Dir(sXMLPath) <> "" Then
Kill sXMLPath
End If
Application.ExportXML acExportQuery, "qryExportXML", sXMLPath


ErrorHandler:
msgbox err.number

end sub



rgds

Z

How are you exporting?
Patrick

Zodiac said:
Zodiac...
I would have thought the same that u wouldn't need that.
Patrick

:

Hi all,

I have exported a XML from Access an it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:eek:d="urn:schemas-microsoft-com:eek:fficedata"
generated="2005-05-10T05:25:59">
<qryExportXML>
<Name>Janssens NV</Name>
<LoginWeb>Jans</LoginWeb>
<PWDWeb>Jans</PWDWeb>
<Descrtiption>Klant</Descrtiption>
<Description>Groep A</Description>
<DiscountPercentage>1</DiscountPercentage>
</qryExportXML>
.......

I' trying to read it from an ASP.net page with the following code:


dstPasswords.ReadXml(MapPath("\data\contacts2.xml"))
dtblPasswords = dstPasswords.Tables(0)
arrUsers = dtblPasswords.Select("Name=' " & sUserName & "'")


However I always bump on this error message

System.Data.EvaluateException: Cannot find column [Name].


After some searching I foud that if I delete xmlns:eek:d="urn:schemas-
microsoft-com:eek:fficedata" from the file the column gets found
without a problem!!!


Can someone explain to me wat the problem is?

thks..

rgds

Z.
How to get rid of it.. Every export from access returns this string..

rgds,

Z
 
K

Ken Cox [Microsoft MVP]

The data you want is in the second table of the dataset, not the first one.

Try it this way?

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim ds As New DataSet
ds.ReadXml(Server.MapPath("accessdata.xml"))
DataGrid1.DataSource = ds.Tables(1)
DataGrid1.DataBind()
End Sub

Ken
Microsoft MVP [ASP.NET]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top