Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Import XML
Jan Holm 
     
5 years ago
Hi,
I am trying to import XML into my application. It works well with one hugh problem. The records created does not show relationship.
I am importing a set of Beer recipes. The XML structure includes the following principles:
<Recipes>
  <Receip> 1:st
     ..... ingredience etc
  <\Receip>
  <Receip> 2st
     ..... ingredience etc
  <\Receip>
      :      :
<\Receip>

When importing an XML file Access creates ingredience records but no relationship i.e. it is not possible to which ingredience belongs to which receip.

Is there a solution to this?
Regards Jan Holm
Richard Rost  @Reply  
          
5 years ago
Do you have proper IDs in your data? Access won't just magically create relationships if you don't have primary and foreign keys.
Richard Rost  @Reply  
          
5 years ago
Let me see a sample of the data - both tables. Just a few records.
Jan Holm OP  @Reply  
     
5 years ago
What ever I try to copy here it looks like a mess. I will send you a very small database, just the imported records and the xml file.

Its in an e-mail called "Document related to the "Import XML" question in access forum" from Jan Holm to [email protected]

/ Regards Jan Holm
Alex Hedley  @Reply  
           
5 years ago
There are a couple of sites where you can post Code Snippets:

https://gist.github.com/

https://pastebin.com/
Richard Rost  @Reply  
          
5 years ago
Jan, I received your email. I'll take a look at it as soon as I get some time.
Richard Rost  @Reply  
          
5 years ago
OK, sorry for the delay, Jan. I took a few minutes and looked over the XML files you sent me. Basically, the data is all there, but it wasn't EXPORTED to be relational. For example, if you look at the RECIPE table, it's got a field called NAME (which is a big no-no in Access) and you've got Burton Ale, Dry Stout, Porter, and Wit. No RecipeID in the table. So now you look at another table like YEAST which should (I believe) be a related sub-table to RECIPE, and it's got the NAME field again with the same 4 listed names. Again, no IDs. So whomever built the original database didn't know about relationships. The only way to solve this is to import the data (which imports easily into Access) and then add primary and foreign key fields where needed (a RecipeID in both the RECIPE and YEAST tables) and then use update queries to change the names in the YEAST tables to IDs. I cover how to do this in Access Expert 14.
Jan Holm OP  @Reply  
     
5 years ago
Ok, thanks! Will do that.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/30/2026 8:47:27 AM. PLT: 1s