title: SQL Update Command In Visual Studio
body: <p>I'm having some trouble with UPDATE commands in Visual Studio.<br>
  I'll get right to the point.<br></p>
  
  <p>I have a MS Access relational database back end and I have connected it in vb and I can display records and such however I can't get it to update.
  I have this in Form_Load</p>
  
  <pre><code>Dim strQuery As String = "SELECT ContractID AS [Contract ID], ProductName AS [Product Name], SigningDate AS [Date Signed], StartDate AS [Start Date], EndDate AS [End Date] FROM ((PolicyContract) INNER JOIN Clients on PolicyContract.ClientID = Clients.ClientID) INNER Join Products on PolicyContract.ProductID = Products.ProductID WHERE PolicyContract.ClientID = '" + clientID + "' ORDER BY PolicyContract.ContractID;"
  
      'initialise the data adapter
      daPolicyContract = New OleDbDataAdapter(strQuery, connection)
      'initialise the dataset
      dsAllroundInsurance = New DataSet
      'fill the dataset
      daPolicyContract.Fill(dsAllroundInsurance, "PolicyContract")
  
      'bind data grid to data in PolicyContract table
      dgvPolicies.DataSource = dsAllroundInsurance.Tables("PolicyContract")
      'autosize columns to fit grid size
      dgvPolicies.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
  </code></pre>
  
  <p>It works fine, It displays the right records but I want to update the records.<br>
  When I click a button I want to update the "EndDate" value for a specific Contract. When I execute this command:<br></p>
  
  <pre><code>UPDATE ((PolicyContract) 
  INNER JOIN Clients
  ON PolicyContract.ClientID = Clients.ClientID)
  INNER JOIN Products
  ON PolicyContract.ProductID = Products.ProductID
  SET PolicyContract.EndDate = '1/1/1111'
  WHERE PolicyContract.ContractID = 'C100102';
  </code></pre>
  
  <p>in MS Access it Updates correctly, so the command is okay. When I try to execute the command in a click event handler like this:</p>
  
  <pre><code>daPolicyContract.UpdateCommand = New OleDbCommand("UPDATE ((PolicyContract) INNER JOIN Clients ON PolicyContract.ClientID = Clients.ClientID) INNER JOIN Products ON PolicyContract.ProductID = Products.ProductID SET PolicyContract.EndDate = '1/1/1111' WHERE PolicyContract.ContractID = 'C100102';", connection)
  </code></pre>
  
  <p>Nothing happens, I don't get an error but it still doesn't update. I'm pretty sure vb is executing the command but its not updating the database.<br>
  Any help would be appreciated, Thanks.</p>