title: Error when updating Database using DataGridView in vb.net and MS-Access
body: <p>While running the below code getting this error</p>
  
  <blockquote>
    <p>Dynamic SQL generation for the UpdateCommand is not supported against
    a SelectCommand that does not return any key column information.</p>
  </blockquote>
  
  <p>I know the answer is to set a primary key which i have not done. But my issue is in this table there is no primary key. The table list process accounts for employees in which one employee may work for more than one process and one process has more than one employee. I have marked the primary key in the main employee table and also edited the relationships in the database. Still the Update command does not work. Here is my code:</p>
  
  <pre><code>    con.Open()
      sql = "SELECT *  FROM employeerecord WHERE [Key]=" &amp; Key
      Dim cmd1 As New OleDbCommand(sql, con)
      da = New OleDbDataAdapter(cmd1)
      Dim cmdb As New OleDbCommandBuilder(da)
      cmdb.QuotePrefix = "["
      cmdb.QuoteSuffix = "]"
      da.Update(ds.Tables("EmployeeRecord"))
  
      sql = "SELECT *  FROM processesrecord WHERE [Key]=" &amp; Key
      cmd1 = New OleDbCommand(sql, con)
      da = New OleDbDataAdapter(cmd1)
      cmdb = New OleDbCommandBuilder(da)
      cmdb.QuotePrefix = "["
      cmdb.QuoteSuffix = "]"
      da.Update(ds.Tables("ProcessRecord"))
      con.Close()
  </code></pre>
  
  <p>How do i come around this?</p>