1

I use Access to update a series of ~300 files between ~20 databases which I built/maintain the back end of, but the end users who operate the database are novice at best when it comes to anything tech related. This has been working great for the exports I am allowed to submit in CSV or XLSX, but now I need to tackle the large chunk of exports that must match a specific XML template on export. I can import XML fine, but I am struggling to get it back into the exact same XML format ~100 times without needing the user to know how to manually update files. Currently I have the export in CSV and the user just copies and pastes the column into the XML file, but now we are at a point where we are talking about doing that for ~100 files a week. It's not pretty.

The XML file format I need to match has set text in the first 7 rows that needs to remain consistent each time and has nothing to do with updates in the database. Row 8 is the field names and the remaining rows are the export of what the database is updating. I should also add that VBA isn't my comfort zone but willing to work on it with guidance.

Any help is appreciated! I've been researching this a lot of and coming up with nothing.

3

1 Answer 1

0

one really neat trick?

Create a blank access database. Then import the xml file. What do you get?

If it spits out one table - then you can use that SAME table, fill the data, and export.

And in fact if the import creates several tables? You can again use that SAME set of tables, and with some code, fill out the tables, and then export as XML - you should get the same output format.

How well the above works? Well, it really depends on how complex the xml data is in the first place. If it is quite simple, then this can be quite a nice solution.

So, once you import the xml file in that test database? Look at the tables. And now try a export of the xml - if the output is the same format - then this can really help you.

Sign up to request clarification or add additional context in comments.

3 Comments

Hi, thank you for the suggestion. I imported the file into a blank database which resulted in 14 tables and most are blank.
ok - so now try a export - do you get the same resulting file? If you do, then you can use code to fill out the tables from "your" data - and you now have conversion system in place. If this does not work, then you going to have to build the output file on your own - that will take code - using the MSXML library + VBA code then would be the next best step. So this xml import trick may or may not help - but it DOES give you an idea of how the xml translates into base related tables.
Yeah this definitely didn't work. I can only export the 14 tables one by one and they all result in gibberish.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.