Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Importing/Linking an XML spreadsheet into Access

Posted on 2011-03-13
17
Medium Priority
?
548 Views
Last Modified: 2013-11-27
Hi Experts,

What is the best way to import/Link an XML spreadsheet into Access?

If I try importing as an XML file it takes forever.
I can convert it to Excel & then it imports fine, but is that the best way?

I mainly work with Office 2003,  but it seems that also in 2010 importing as XML is very slow

Thanks,

Gary
0
Comment
Question by:tbsgadi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
  • 2
  • +2
17 Comments
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35122003
The following example imports an XML file into a new table named XMLFILE in the current database.

Application.ImportXML DataSource:="XMLFILE.xml", ImportOptions:=acStructureAndData

Sid
            
0
 
LVL 85
ID: 35123228
How are you importing now? XML is nothing more than a strucutred text file, and you can use the XML libraries to do this, but in some cases that's slower than doing it with the code suggested by Sid.
0
 
LVL 46

Author Comment

by:tbsgadi
ID: 35125917
I'm trying to import an Excel XML spreadsheet containing 3 sheets.
As I wrote the only success I'm having, is first to convert it to normal excel & then link or import it.

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 85
ID: 35127206
I'm not clear what you mean by "xml spreadsheet". Is this a spreadsheet saved in XML format, or something along those lines?
0
 
LVL 46

Author Comment

by:tbsgadi
ID: 35127270
Yup..It looks the same as excel but with less functionality.
http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35138564
Hey, buddy...

Define "Forever" in chronological terms...
;-)

How big are these files?
Any special XML formatting?

I just saved the Northwind sample file "Orders" table  (830 records) as an XML file in Excel, then imported it into Access, ...it took no longer than a straight xls file import...

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35138628
what's the code you are using for the import?
0
 
LVL 46

Author Comment

by:tbsgadi
ID: 35138973
Forever is less than eternity but more than a minute!

To import the same excel takes a second.

No special formatting...regular excel 3 sheets.
0
 
LVL 46

Author Comment

by:tbsgadi
ID: 35139336
The same happens both with the above code & manually.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35140257
"Code above"?
0
 
LVL 46

Author Comment

by:tbsgadi
ID: 35140360
Application.ImportXML DataSource:="XMLFILE.xml", ImportOptions:=acStructureAndData
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35141033
How about something like this:

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml, "TargetTableName", "C:\yourFolder\YourFile.XML", True
0
 
LVL 46

Author Comment

by:tbsgadi
ID: 35145747
Thanks, not supported in Access 2003

In 2010 it only works if I first open the workbook, otherwise get error "External Table not in expected format."
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35148006
Sorry, I forgot about the Acc03 requirement...

...I never really had the time to work with XML, but I do know that all the Formatting/shcema/template stuff is a bit over my head...

You may want to ask the mods to link this Q to the appropriate XML zone(s)
0
 
LVL 46

Accepted Solution

by:
tbsgadi earned 0 total points
ID: 35148568
I think it's more relevant to the Access/Excel zones.
It looks like I'll be sticking to converting it first to Excel.
0
 
LVL 50
ID: 35372870
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question