One approach would be to
- open the excel spreadsheet
- read the data in the spreadsheet
- construct an update statement based upon data from [2]
- Execute the update statement
- repeat steps [3] and [4] until there's are no more data
- close the app.
For the Excel manipulation, you could use automation, but, this approach is rather slow, and it requires that the client machine have excel installed. Consider
using ADO to connect to the excel file, as well as to the Access data file...
When updating the target data file, you have a couple of approaches with ADO. You could, or course, simply issue SQL UPDATE statements against the target table using the connection object's
Execute method. You would open the database connection, then build a SQL statement which looks similar to
Code:
UPDATE YourTableName
Set FieldName2 = 'Value2', FieldName3 = 'Value3'
Where FieldName2 = '12345'
With ADO, another option could be to Open an ADO recordset in the Bulk edit mode, then issue a series of Filter statements against the recordset (one for each line of data in the Excel file.) Each time you update the filter value, the recordset now contains 'just' the records which match the filter condition, so you could iterate through the recordset, directly updating the fields. Then, set the filter property to
adFilterNone and repeat the last group of statements until no more source data. Then, perform the recordset batch update.