Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Posts
    123

    Red face Unanswered: How to append XML data to existing table

    How do I get the ImportXML method to append data to an existing table using code? I can obviously do it through File...Get External Data...etc where the import dialog box has a selection for "Append Data".

    But it doesn't seem to be part of the ImportXML method?

    Application.ImportXML DataSource:="C:\Documents and Settings\nbkcp6y\Desktop\7.xml", ImportOptions:=acStructureAndData

  2. #2
    Join Date
    Feb 2004
    Location
    CT,USA
    Posts
    250
    Look up transfertext function in help:
    expression.TransferText(TransferType, SpecificationName, TableName, FileName, HasFieldNames, HTMLTableName, CodePage)

    where, TransferType=acImportHTML

    If you don't know vb code then use a macro with same function; it will break down the parameters for you.

  3. #3
    Join Date
    Aug 2003
    Posts
    123
    I'm importing with XML, not HTML. The TransferText and macro don't work with XML.

    When using the Import button in the toolbar (File...Get External Data...Import), one can select whether to append the new XML data to the existing data or not. However, if using the ImportXML method in VB, I can't seem to get this option.

  4. #4
    Join Date
    Aug 2003
    Posts
    123

    Talking How to append XML data to existing table - Never Mind!

    Geez, that was easy. I realized it's right in ImportOptions as acAppendData. Sometimes it helps to try typing your own code instead of copying and pasting.

    Quote Originally Posted by jrn0074
    How do I get the ImportXML method to append data to an existing table using code? I can obviously do it through File...Get External Data...etc where the import dialog box has a selection for "Append Data".

    But it doesn't seem to be part of the ImportXML method?

    Application.ImportXML DataSource:="C:\Documents and Settings\nbkcp6y\Desktop\7.xml", ImportOptions:=acStructureAndData

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •