title: Identical update - inner join statements don't work?
body: <p>My program is throwing the following error</p>
  
  <blockquote>
    <p>ERROR in UPDATE statement: OleDb (0x80040E14) </p>
  </blockquote>
  
  <p>and nothing else. </p>
  
  <p>Over the past week I've been having continuous trouble tweaking this code with minor adjustments yet everything always happens to break down.</p>
  
  <p>This is the identical sample that works:</p>
  
  <pre><code>conn.Open();
  string sqls = @"INSERT INTO ABCD SELECT * FROM [Excel 12.0;HDR=YES;DATABASE=" + openFileDialog.FileName + "].[" + txtSheetName.Text + "$];";
  OleDbCommand cmd = new OleDbCommand();
  cmd.Connection = conn;
  cmd.CommandText = sqls;
  cmd.ExecuteNonQuery();
  string updater =
      @"UPDATE ACTB " + @"INNER JOIN ABCD on ACTB.ID = ABCD.ID " +
      @"SET ACTB.Started = ABCD.Started, " +
      @"ACTB.Ended = ABCD.Ended ";
  cmd.CommandText = updater;
  cmd.ExecuteNonQuery();
  string deleter = @"DELETE from ABCD";
  cmd.CommandText = deleter;
  cmd.ExecuteNonQuery();
  conn.Close();
  </code></pre>
  
  <p>I just pasted this so that you guys know the logic of the join statement is already sound. I'm adding stuff from an Excel file to an Access database where ID's match. ACTB contains every single field, and has 20 fields of which the rest are irrelevant except for the last four: CTC, POI, DOI, AMT and of course, ID at the start. The excel file is structured the same way: ID, CTC, POI, DOI, AMT with some data and ID data that matches the access database data.</p>
  
  <p>And the code with hiccups:</p>
  
  <h2>Insert Statement</h2>
  
  <pre><code>conn.Open();
  string sqls = @"INSERT INTO ACTC SELECT * FROM [Excel 12.0;HDR=YES;DATABASE=" + openFileDialog.FileName + "].[" + txtSheetName.Text + "$];";
  OleDbCommand cmd = new OleDbCommand();
  cmd.Connection = conn;
  cmd.CommandText = sqls;
  cmd.ExecuteNonQuery();
  </code></pre>
  
  <p>The insert statement alone works, so I know the ACTC table can be read.</p>
  
  <h2>Rest of Code:</h2>
  
  <pre><code>string updater =
      @"UPDATE ACTB " + @"INNER JOIN ACTC on ACTB.[ID] = ACTC.[ID] " +
      @"SET ACTB.[CTC] = ACTC.[CTC], " +
      @"SET ACTB.[POI] = ACTC.[POI], " +
      @"SET ACTB.[DOI] = ACTC.[DOI], " +
      @"ACTB.[AMT] = ACTC.[AMT] ";
  cmd.CommandText = updater;
  cmd.ExecuteNonQuery();
  string deleter = @"DELETE from ACTC";
  cmd.CommandText = deleter;
  cmd.ExecuteNonQuery();   
  conn.Close();
  </code></pre>
  
  <p>Am I looking at another reserved word issue?<br>
  What's wrong with my update statement?<br>
  And how do I make these error messages make more sense?</p>