Results 1 to 4 of 4
  1. #1
    Join Date
    May 2005
    Posts
    125
    Provided Answers: 1

    Unanswered: Importing XML in Access (was "Help with code please")

    Hi, wondering if you guy's could help.

    Here is part of the code I am currently using to import data through a form, which is works absolutly fine

    'This routine imports the *.xls file.
    Me!lblFeedback = "Standy by, Importing data......"
    Me.Repaint
    MsgBox "Importing from: " & Me!txtCustFilePath
    MsgBox "Importing to table: " & GetNamePart(Me!txtCustFilePath)

    If Me!HasHeader = False Then
    DoCmd.TransferSpreadsheet acImportDelim, , GetNamePart(Me!txtCustFilePath), Me!txtCustFilePath
    Else
    DoCmd.TransferSpreadsheet acImportDelim, , GetNamePart(Me!txtCustFilePath), Me!txtCustFilePath, True

    End If
    MsgBox "Data Imported - New table is called: " & GetNamePart(Me!txtCustFilePath)

    End Sub

    What I need help with, I now need to import a xml file, but I do not know what command to put in place of "DoCmd.TransferSpreadsheet acImportDelim"

    Could you give me some guidance, Thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    It's partially possible in Access 2007 (undocumented value 10 for spreadsheet type), otherwise you have to write your own parser to import data from such files.
    Have a nice day!

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    George
    Home | Blog

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Another very interesting article on the subject can be found here:
    Import XML Data Into Microsoft Access — DatabaseJournal.com
    Have a nice day!

Posting Permissions

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