问题
While I think I may be able to work out a hack job solution solution, I'm hoping to identify the most simple way to regularly update a MS Access table to exactly match the contents of a linked .TXT file. I want MS Access to change values in a row in the table if the values in the same row in the linked .TXT file have changed, as well as add any new rows and delete any rows that are no longer in the .TXT file.
I presently have an append query to add the new rows. Is it possible to do all of the above in one query, or do I have to run both an append and (one or two?) update query/queries? Any/all advice is welcome. Cheers.
回答1:
You can link (attach) the text file. Then run a combined append/update query:
Update and Append Records with One Query
When a new text file arrives, just replace the linked text file with the new file.
来源:https://stackoverflow.com/questions/45227504/how-to-regularly-update-ms-access-table-from-linked-txt-file