Is it possible in Access 2007 to update records by loading data from an XML file? For instance I have a number of products each with a unique barcode. When I read the XML file, if the barcode isn’t in the database it should be added, however if it is in the database it should update the fields associated with that barcode. Is this possible to do with Access, or should I be looking elsewhere?
Share
You could use the Application.ImportXML Method to import the data into an Access table. From there, it’s easy Access SQL to identify which of the existing records in your master barcode table need changing and
UPDATEthem accordingly, orINSERTnew barcode records. However,ImportXMLchokes on all but the simplest XML schemas.Alternatively, you can open the XML doc as a MSXML DOMDocument and use its methods to extract the values you want, then compare with your stored barcode records and
UPDATEorINSERTas need. If you want to go that route, you can find some tips at this SO answer: stackoverflow.com/a/3398999/77335