A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

export xml - slow Access 2007



 
 
Thread Tools Display Modes
  #1  
Old September 1st, 2009, 07:27 PM posted to microsoft.public.access
Gary[_5_]
external usenet poster
 
Posts: 5
Default export xml - slow Access 2007


I have a temp table in Access 2007 that is the data source for export
to XML. Outputting the XML file is very slow - even when the file is
created locally (accdb is on my C:drive -- and output is to C

The temp table contains about 700 records of with some 40 fields.
Schema file is not created. Just a single file of element-centered
XML. Takes about 35-40 seconds to generate the file locally. This is a
relatively small data set compared others that I will need to export.
They can be as large as 14,000 records. And in production, the file
must be generated to a network location, which would presumably be
even slower.

Here's the VBA used for output:

Application.ExportXML ObjectType:=acExportQuery, DataSource:="NewGL",
_
DataTarget:="C:\TApps\Pvr\NewGL.xml"

Does anyone know of ways to make the export faster? Thanks for any
suggestions.
  #2  
Old September 1st, 2009, 11:27 PM posted to microsoft.public.access
James A. Fortune
external usenet poster
 
Posts: 903
Default export xml - slow Access 2007

Gary wrote:
I have a temp table in Access 2007 that is the data source for export
to XML. Outputting the XML file is very slow - even when the file is
created locally (accdb is on my C:drive -- and output is to C

The temp table contains about 700 records of with some 40 fields.
Schema file is not created. Just a single file of element-centered
XML. Takes about 35-40 seconds to generate the file locally. This is a
relatively small data set compared others that I will need to export.
They can be as large as 14,000 records. And in production, the file
must be generated to a network location, which would presumably be
even slower.

Here's the VBA used for output:

Application.ExportXML ObjectType:=acExportQuery, DataSource:="NewGL",
_
DataTarget:="C:\TApps\Pvr\NewGL.xml"

Does anyone know of ways to make the export faster? Thanks for any
suggestions.


Once you know the structure of the XML file, why not hard code strings
for the parts that don't change? Then you can base a recordset on the
query and fill arrays with the values in a single pass using ADO or DAO.
After that, printing the variable XML part to the output file should
proceed quite rapidly within, say, two loops. Note that the array index
can only go up to 32,767 if it is not mathematically shifted to utilize
the negative indices, so 14K records should fit. It would be
interesting to compare the time you get with the time that ExportXML takes.

James A. Fortune

  #3  
Old September 9th, 2009, 10:36 PM posted to microsoft.public.access
James A. Fortune
external usenet poster
 
Posts: 903
Default export xml - slow Access 2007

Gary wrote:

It's working now - and I'm pleased with the result -- 5 seconds to
output instead of 45. Being new to XML, I had included the "-" and "+"
handles in the static code that I wrote out. The "Invalid at the top
level of the document" error went away after that change. Also had a
few other adjustments to make to that my output matched ExportXML
output exactly.

Thanks for your help! This technique will be very useful.


Thanks for the information. Seeing some hard numbers gives me a better
feel for how much time parts of the ExportXML process take.

James A. Fortune

  #4  
Old September 9th, 2009, 10:36 PM posted to microsoft.public.access
James A. Fortune
external usenet poster
 
Posts: 903
Default export xml - slow Access 2007

Gary wrote:

It's working now - and I'm pleased with the result -- 5 seconds to
output instead of 45. Being new to XML, I had included the "-" and "+"
handles in the static code that I wrote out. The "Invalid at the top
level of the document" error went away after that change. Also had a
few other adjustments to make to that my output matched ExportXML
output exactly.

Thanks for your help! This technique will be very useful.


Thanks for the information. Seeing some hard numbers gives me a better
feel for how much time parts of the ExportXML process take.

James A. Fortune

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.