XML into Access 2003

  • Thread starter Thread starter Maarten
  • Start date Start date
M

Maarten

Hi,

I am working with Access 2007 and importing an xml file, which in this
version is a piece of cake.
Since Access 2003 doesn't provide for importing xml, can I import xml files
using VBA? The import functionality will be used monthly for several files.
Does anybody have code for that? Or is there an Access add-on somewhere on
the internet which 'fixes' this for Access 2003?

Any help I can get would be much appreciated.
 
Hi,

I've literally just been doing this. Have a crack with this which brings up
a filedialog box enabling the user to find their file:

Dim f As FileDialog

Set f = Application.FileDialog(msoFileDialogFilePicker)
f.Filters.Clear
f.Filters.Add "xml", "*.xml", 1
f.Show

Application.ImportXML DataSource:=f.SelectedItems(1),
ImportOptions:=acAppendData

The above code will let the user find the file to be imported and then
append the data to existing data tables. In my instance, this is what I need
to occur. Check the help files of the importxml method if you need to import
in a different manner.

A word of warning might be that whilst the above works fine, it causes
immense database bloat - twice as much as a manual import. I don't know why,
but compacting is the answer.

Regards,

Steve
 
Forgot to mention that you might need to make sure your database references
either microsoft office object library 11.0 or 12.0. 12.0 works for me
although the helpfile says I should use 11.0

Steve
 
Back
Top