Automatically importing an XML file to Access?

SomethngWicked

Board Regular
Joined
Feb 18, 2015
Messages
75
Hi Access Wizards,

I have a MS Access 2010 Database that I use to import an XML file on a daily basis. The XML file is generated each morning via FTP and lands in the same folder as the Access database. Is it possible to have Access automatically pick up/import this file? The XML file name stays the same with the exception of the end date (e.g.: FileName_03182019). This is a somewhat tedious process and it would be awesome to somehow automate this step.

I've done some preliminary research online, but I can't find anything conclusive. Thanks for the help!
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

andrewmrichards

New Member
Joined
Aug 28, 2013
Messages
7
Hi Access Wizards,

I have a MS Access 2010 Database that I use to import an XML file on a daily basis. The XML file is generated each morning via FTP and lands in the same folder as the Access database. Is it possible to have Access automatically pick up/import this file? The XML file name stays the same with the exception of the end date (e.g.: FileName_03182019). This is a somewhat tedious process and it would be awesome to somehow automate this step.

I've done some preliminary research online, but I can't find anything conclusive. Thanks for the help!

Yes, it is possible, but not in a particularly elegant way...

3 options:

1. If the database runs every day (because at least one person logs in every day) then you could have, as part of the startup code a check to see whether the XML folder has been scanned yet today, or whether the XML file was last imported (depending on what exactly you want). I'd use a table which holds values such as "Date XML feed last imported" and if this is not "today" then go and import / scan for a new file and import it.

2. If you have a copy of the database that runs 24/7 (not everyone does, but I had a client who had a copy of the database with a whole series of this sort of task, scheduled to run at different times each day) then you can use the OnTimer event to check once a minute "Are there tasks to run at this time today that haven't already run" and one of these tasks could be to import the XML file.

3. You can buy a commercial solution, such as FMS Inc's Microsoft Access Scheduler (Total Visual Agent): https://www.fmsinc.com/MicrosoftAccess/Scheduler.html

Hope this helps!
 

Watch MrExcel Video

Forum statistics

Threads
1,109,444
Messages
5,528,799
Members
409,835
Latest member
Mafu1267

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top