1

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?

1 Answer 1

1

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 UPDATE them accordingly, or INSERT new barcode records. However, ImportXML chokes 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 UPDATE or INSERT as need. If you want to go that route, you can find some tips at this SO answer: stackoverflow.com/a/3398999/77335

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.