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

Exporting To XML File

AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file begins
with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>

and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the XML file
so all the file contains is data?

Thanks!

Steve

Nov 13 '05 #1
11 5839
I suspect that what you are seeing is "well-formed XML" -- why would you
want to eliminate any part of it to make it "not-so-well-formed"? Does it
not import properly into the target application, and you have determined
that it is these particular markup items that prevent it doing so?

If all you want is data, you could use comma-delimited text (aka
comma-separated-variable, CSV) instead.

The only reason to use XML, generally, is that the data is going to an
application that accepts XML. Otherwise, you'd want to export in some other
format.

Larry Linson
Microsoft Access MVP
"PC Datasheet" <no****@nospam.spam> wrote in message
news:GM*****************@newsread1.news.atl.earthl ink.net...
AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file begins
with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>

and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the XML
file so all the file contains is data?

Thanks!

Steve

Nov 13 '05 #2

"PC Datasheet" wrote:
AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file begins
with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>

and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the XML
file so all the file contains is data?

Hi Steve,

One small part of my job is to take University
Line Schedule data and print a report to a pdf
file. I use pdf995 which allows adding Bookmarks
after report has printed if they are in a "xml" file
which is not "well-formed."

As I print the report, I save Page number,
College, and Dept in a table.

I then run a function that writes this data
to the "xml" file in form they require by
opening a file for output, cycling through
a recordset to table above, and printing
lines to the file.

So...it's not difficult to "do-it-yourself."
If you'd like, I could post the code, but
the "form" of the output is specific to
pdf995 bookmarks.

I'm curious though as to how you would expect to
"header" a record in your xml....

gary
Nov 13 '05 #3
"PC Datasheet" <no****@nospam.spam> wrote in message
news:GM*****************@newsread1.news.atl.earthl ink.net
AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file
begins with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>
Actually, the dashes that precede the tags are an artifact of Internet
Explorer, reflecting the expansion of a hierarchical node structure --
they aren't in the XML file itself, as you'll see if you edit it in
Notepad.
and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the
XML file so all the file contains is data?


Those tags, which I expect are really <QryExportWOOnSelectedShowDate>
.... data elements ... </QryExportWOOnSelectedShowDate>, are required by
the XML structure. Each pair marks the beginning and end of an element
of the document being represented by the XML file. In this case, the
element is a record. You can't get rid of them and still have a
well-formed XML document.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
Nov 13 '05 #4
Hi Gary,

Thanks for your response! Dirk Goldgar (who also responded to this thread)
pointed me to the Application,ExportXML method in AccessXP. I used it to
export a query to XML. Now I may sound a little like I know what I am
talking about but it's a facade. I created a routine to export a series of
queries to XML. It worked; the files were in the specified folder but I know
nothing else about XML. So you ask what I would expect to "header" a record
in my xml... I can't answer that because I do no know what you are speking
about. What does it mean to "header" a record?

Thanks again, Gary!

Steve
"Gary Walter" <ga**********@nospamwamego.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

"PC Datasheet" wrote:
AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file begins
with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>

and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the XML
file so all the file contains is data?

Hi Steve,

One small part of my job is to take University
Line Schedule data and print a report to a pdf
file. I use pdf995 which allows adding Bookmarks
after report has printed if they are in a "xml" file
which is not "well-formed."

As I print the report, I save Page number,
College, and Dept in a table.

I then run a function that writes this data
to the "xml" file in form they require by
opening a file for output, cycling through
a recordset to table above, and printing
lines to the file.

So...it's not difficult to "do-it-yourself."
If you'd like, I could post the code, but
the "form" of the output is specific to
pdf995 bookmarks.

I'm curious though as to how you would expect to
"header" a record in your xml....

gary

Nov 13 '05 #5
Thanks for the information, Dirk! BTW, I got Application.ExportXML to work
and created a routine to export a series of queries.

Steve
"Dirk Goldgar" <dg@NOdataSPAMgnostics.com> wrote in message
news:ux**************@tk2msftngp13.phx.gbl...
"PC Datasheet" <no****@nospam.spam> wrote in message
news:GM*****************@newsread1.news.atl.earthl ink.net
AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file
begins with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>


Actually, the dashes that precede the tags are an artifact of Internet
Explorer, reflecting the expansion of a hierarchical node structure --
they aren't in the XML file itself, as you'll see if you edit it in
Notepad.
and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the
XML file so all the file contains is data?


Those tags, which I expect are really <QryExportWOOnSelectedShowDate>
... data elements ... </QryExportWOOnSelectedShowDate>, are required by
the XML structure. Each pair marks the beginning and end of an element
of the document being represented by the XML file. In this case, the
element is a record. You can't get rid of them and still have a
well-formed XML document.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Nov 13 '05 #6
"PC Datasheet" <no****@nospam.spam> wrote in message
news:cq*****************@newsread3.news.atl.earthl ink.net
Thanks for the information, Dirk! BTW, I got Application.ExportXML to
work and created a routine to export a series of queries.


I guessed as much. You're welcome.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
Nov 13 '05 #7
Hi Steve,

I imagine you probably understood better
from Dirk's sage response, but just in case...

Suppose I had a table called Books. Two records
might look like:

Author: John L. Viescas
Title: Building Microsoft Access Applications
ISBN: 0-7356-2039-3
Pub: Microsoft Press
Edition: 2005

Author: Ken Henderson
Title: The Guru's Guide to Transact-SQL
ISBN: 0-201-615760-2
Pub: Addison-Wesley
Edition: 2000

At its very basic, XML is a markup language
that will allow you to produce your hierarchy of
records using beginning and ending tags
(which *you* can define).

It might be loosely analogous with you setting
up headers and footers in an Access report.

In our example, we might define the "header and
footer" tags for a book record as

<book>
</book>

then within each book "header/footer" tag set, we use similar
tags for each fieldname within the record and the field
values go between those tags. At its simplest form,
our XML file might look like:

<book>
<Author>John L. Viescas</Author>
<Title> Building Microsoft Access Applications</Title>
<ISBN> 0-7356-2039-3</ISBN>
<Pub> Microsoft Press</Pub>
<Edition> 2005</Edition>
</book>

<book>
<Author>Ken Henderson</Author>
<Title> The Guru's Guide to Transact-SQL</Title>
<ISBN> 0-201-615760-2</ISBN>
<Pub> Addison-Wesley</Pub>
<Edition> 2000</Edition>
</book>

In your export, it looks like the
process chose to use your query
name for the "header/footer" tags
of a record

<QryExportWOOnSelectedShowDate>
......
......
</QryExportWOOnSelectedShowDate>

I am not an XML expert. It gets a lot more
complicated when you throw in powerful
namespaces, style sheets, and formatting,
but a "well-formed" XML file all starts with
the basics above.

good luck,

gary

{I probably should not have confused
things by using "header" in my original
response...sorry}

"PC Datasheet" wrote:

Thanks for your response! Dirk Goldgar (who also responded to this thread)
pointed me to the Application,ExportXML method in AccessXP. I used it to
export a query to XML. Now I may sound a little like I know what I am
talking about but it's a facade. I created a routine to export a series of
queries to XML. It worked; the files were in the specified folder but I
know nothing else about XML. So you ask what I would expect to "header" a
record in my xml... I can't answer that because I do no know what you are
speking about. What does it mean to "header" a record?

Thanks again, Gary!

Steve
"Gary Walter" <ga**********@nospamwamego.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

"PC Datasheet" wrote:
AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file
begins with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>

and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the XML
file so all the file contains is data?

Hi Steve,

One small part of my job is to take University
Line Schedule data and print a report to a pdf
file. I use pdf995 which allows adding Bookmarks
after report has printed if they are in a "xml" file
which is not "well-formed."

As I print the report, I save Page number,
College, and Dept in a table.

I then run a function that writes this data
to the "xml" file in form they require by
opening a file for output, cycling through
a recordset to table above, and printing
lines to the file.

So...it's not difficult to "do-it-yourself."
If you'd like, I could post the code, but
the "form" of the output is specific to
pdf995 bookmarks.

I'm curious though as to how you would expect to
"header" a record in your xml....

gary


Nov 13 '05 #8
Steve, try this code to create some pure xml for any table ...
Function CreatePage(sTable As String) As String

Dim mydb As Database
Dim rst As Recordset
Dim fld As Field
Dim strText As String
Set mydb = CurrentDb
Set rst = mydb.OpenRecordset(sTable, dbOpenSnapshot)

strText = "<?xml version=""1.0""?>" & vbcrlf & vbcrlf
strText = strText & "<" & sTable & ">" & vbcrlf

With rst
Do Until .EOF
For Each fld In rst.Fields
strText = strText & " <" & fld.Name & ">" & rst(fld.Name) & "</" & fld.Name & ">" & vbcrlf
Next
strText = strText & vbcrlf
.MoveNext
Loop
End With
strText = strText & "</" & sTable & ">" & vbcrlf

Set rst = Nothing
Set mydb = Nothing

CreatePage = strText

End Function
--

Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast/
"PC Datasheet" <no****@nospam.spam> wrote ...
AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file begins with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>

and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the XML file so all the file contains is data?

Thanks!

Steve

Nov 13 '05 #9
The best thing to do is go http://www.w3schools.com/ and read the LearnXML
under XML Tutorials. It is quite easy to grasp basic XML. You cannot
operate without a basic understanding of XML. I mean, not if you think you
are really going to do anything with it. You also need to figure out what a
schema is. If you import XML into Access without a schema, all the fields
will be data type Text. That will truncate any long memo fields, and that
is not good. At least I was not too happy about it. If I am saying anything
wrong, I am sure I will be immediately corrected.

Mike Gramelspacher
Ferdinand, Indiana
"PC Datasheet" <no****@nospam.spam> wrote in message
news:2h*****************@newsread2.news.atl.earthl ink.net...
Hi Gary,

Thanks for your response! Dirk Goldgar (who also responded to this thread)
pointed me to the Application,ExportXML method in AccessXP. I used it to
export a query to XML. Now I may sound a little like I know what I am
talking about but it's a facade. I created a routine to export a series of
queries to XML. It worked; the files were in the specified folder but I
know nothing else about XML. So you ask what I would expect to "header" a
record in my xml... I can't answer that because I do no know what you are
speking about. What does it mean to "header" a record?

Thanks again, Gary!

Steve
"Gary Walter" <ga**********@nospamwamego.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

"PC Datasheet" wrote:
AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file
begins with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>

and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the XML
file so all the file contains is data?

Hi Steve,

One small part of my job is to take University
Line Schedule data and print a report to a pdf
file. I use pdf995 which allows adding Bookmarks
after report has printed if they are in a "xml" file
which is not "well-formed."

As I print the report, I save Page number,
College, and Dept in a table.

I then run a function that writes this data
to the "xml" file in form they require by
opening a file for output, cycling through
a recordset to table above, and printing
lines to the file.

So...it's not difficult to "do-it-yourself."
If you'd like, I could post the code, but
the "form" of the output is specific to
pdf995 bookmarks.

I'm curious though as to how you would expect to
"header" a record in your xml....

gary


Nov 13 '05 #10
First, thanks to all of you!

I'm taking a shortcut here ---

WHAT ARE the big uses of XML? What are the advantages?

Thanks,

Steve
"PC Datasheet" <no****@nospam.spam> wrote in message
news:GM*****************@newsread1.news.atl.earthl ink.net...
AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file begins
with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>

and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the XML
file so all the file contains is data?

Thanks!

Steve

Nov 13 '05 #11
One use I'm seeing more and more of is as a replacement for INI files, since
it allows you to organize the data much easier. In situations where you have
multiple possibilities for a particular value, XML allows you the equivalent
of an array, which (assuming your program checks for the possibility) is
easier than having to check multiple keys.

It's also more reliable for simple text data than csv or fixed-width.

Overall, though, I find it tends to be more "verbose" than the alternatives.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"PC Datasheet" <no****@nospam.spam> wrote in message
news:Ah*****************@newsread2.news.atl.earthl ink.net...
First, thanks to all of you!

I'm taking a shortcut here ---

WHAT ARE the big uses of XML? What are the advantages?

Thanks,

Steve
"PC Datasheet" <no****@nospam.spam> wrote in message
news:GM*****************@newsread1.news.atl.earthl ink.net...
AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file begins
with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>

and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the XML
file so all the file contains is data?

Thanks!

Steve


Nov 13 '05 #12

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

Similar topics

5
by: Jayjay | last post by:
Is it possible to export a report to word and have it include the graphics that are in the report? I'd like to take some of our reports and export them to word so we can email those to the...
2
by: Kenneth | last post by:
How do I remove the limitation in Access that deny me from exporting 24000 rows and 17 columns (in a query) into Excel? Kenneth
1
by: Lasso | last post by:
Hi all, Im having problem in exporting pdf file from crystal report. Now I already can show the crystal report but error when exporting. this is my code: Dim myReport As USERReport = New...
1
by: Mustufa Baig | last post by:
I have an ASP.NET website where I am showing off crystal reports to users by exporting them to pdf format. Following is the code: ---------------- 1 Private Sub ExportReport() 2 Dim oStream...
2
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
6
by: sara | last post by:
I have what I think is a little strange...I have to get data from our payroll system into a specific format (fixed record length) as a .txt or .prn file only to upload to our 401k custodian. I...
12
by: 2b|!2b==? | last post by:
I want to export my C++ classes in a DLL, using ordinal # - rather than by name. Will anyone care to enumerate through the steps required to do this? I am already failiar with exporting classes...
4
by: myemail.an | last post by:
Hi all, I use Access 2007 and have the following problems: when exporting banal select queries (either to Excel or to a csv file) I find that exporting often doesn't work and creates a file with...
1
by: Marty Klunk | last post by:
I have an Access97 data base where we are exporting records out to a text file that is then sent to a customer via EDI transmission. The problem I am having is that during the export process access...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.