How does a piece of data get from the excel file into the database? It's not normal for data on an excel file to end up in a database. Sub Button Click() 'TRUSTED CONNECTION On Error Go To err H Dim con As New ADODB. Recordset Dim str Path As String Dim int Import Row As Integer Dim str First Name, str Last Name As String Dim server, username, password, table, database As String With Sheets("Sheet1") server = . Command Type = ad Cmd Text 'Create the SQL str SQL = "UPDATE TBL SET JOIN_DT = '2013-01-22' WHERE EMPID = 2" 'Pass the SQL to the Command object cmd.
Thus for each line (approx 2500 rows) The database values that match OLD in each column, need to be changed to NEW My current thoughts are to do it in a similar way to this: SQL Statement that Updates an Oracle Database Table from an Excel Spreadsheet Essentially getting Excel to formulate a list of replace statements, though this feels like a horribly convoluted way to deal with the problem!
For example, if you discovered that there was an error in the order quantity, you could change it.
The Total formula on the Input sheet would automatically recalculate, to show the revised amount.
For example, using the Person table from the infamous Adventure Works sample database: You receive a request (in the form of an Excel file), to change the value of Email Promotion attribute to the corresponding value in the list: Starting in cell C2, enter the following text: =”UPDATE Person.
Person set Email Promotion=”&b2&” WHERE Business Entity ID=”&A2 Note: this example deals with only numeric data, character data must be wrapped in single quotes (‘).